mustflow 2.115.17 → 2.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/skill-route-resolution.js +34 -3
- package/package.json +1 -1
- package/templates/default/i18n.toml +49 -13
- package/templates/default/locales/en/.mustflow/skills/INDEX.md +25 -1
- package/templates/default/locales/en/.mustflow/skills/adapter-boundary/SKILL.md +9 -8
- package/templates/default/locales/en/.mustflow/skills/agent-execution-control-review/SKILL.md +13 -1
- package/templates/default/locales/en/.mustflow/skills/api-contract-change/SKILL.md +2 -1
- package/templates/default/locales/en/.mustflow/skills/command-pattern/SKILL.md +11 -7
- package/templates/default/locales/en/.mustflow/skills/concurrency-invariant-review/SKILL.md +3 -1
- package/templates/default/locales/en/.mustflow/skills/credit-ledger-integrity-review/SKILL.md +4 -1
- package/templates/default/locales/en/.mustflow/skills/dual-write-consistency/SKILL.md +170 -0
- package/templates/default/locales/en/.mustflow/skills/durable-workflow-orchestration/SKILL.md +167 -0
- package/templates/default/locales/en/.mustflow/skills/execution-ledger-integrity-review/SKILL.md +161 -0
- package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +5 -3
- package/templates/default/locales/en/.mustflow/skills/llm-token-cost-control-review/SKILL.md +5 -1
- package/templates/default/locales/en/.mustflow/skills/migration-safety-check/SKILL.md +4 -1
- package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/SKILL.md +332 -0
- package/templates/default/locales/en/.mustflow/skills/policy-decision-integrity-review/SKILL.md +170 -0
- package/templates/default/locales/en/.mustflow/skills/public-json-contract-change/SKILL.md +2 -1
- package/templates/default/locales/en/.mustflow/skills/queue-processing-integrity-review/SKILL.md +6 -2
- package/templates/default/locales/en/.mustflow/skills/routes.toml +108 -0
- package/templates/default/locales/en/.mustflow/skills/state-machine-pattern/SKILL.md +5 -3
- package/templates/default/locales/en/.mustflow/skills/structured-concurrency-supervision-review/SKILL.md +155 -0
- package/templates/default/locales/en/.mustflow/skills/transaction-boundary-integrity-review/SKILL.md +5 -2
- package/templates/default/manifest.toml +47 -1
package/templates/default/locales/en/.mustflow/skills/credit-ledger-integrity-review/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skill.credit-ledger-integrity-review
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 2
|
|
6
6
|
lifecycle: mustflow-owned
|
|
7
7
|
authority: procedure
|
|
8
8
|
name: credit-ledger-integrity-review
|
|
@@ -47,6 +47,7 @@ Review credit, point, and wallet balance code as an accounting ledger, not a bal
|
|
|
47
47
|
- The task only reviews general business-rule placement without a balance, ledger, wallet, credit, point, or reconciliation surface; use `business-rule-leakage-review`.
|
|
48
48
|
- The task only designs a generic lifecycle state machine with no ledger, amount, idempotency, balance, reservation, expiry, or reconciliation risk; use `state-machine-pattern`.
|
|
49
49
|
- The task only reviews cache correctness for a non-balance value; use `cache-integrity-review`.
|
|
50
|
+
- The task only reviews soft token, step, concurrency, request-count, or rate budgets that are not prepaid or money-equivalent; use the relevant LLM cost, agent execution, concurrency, or rate-limit skill.
|
|
50
51
|
- The task requires production balance corrections, real refunds, data migrations, or direct database repair without explicit user approval and configured command support.
|
|
51
52
|
|
|
52
53
|
<!-- mustflow-section: required-inputs -->
|
|
@@ -98,6 +99,7 @@ Review credit, point, and wallet balance code as an accounting ledger, not a bal
|
|
|
98
99
|
16. Consume expiry lots deliberately. When credits expire, inspect FIFO, LIFO, earliest-expiry-first, or policy-specific lot allocation. Record lot-level consumption so later refund and audit can reconstruct the path.
|
|
99
100
|
17. Race expiry and usage. Expiry batches must use the same ledger, lock, idempotency, and conditional update rules as user requests. Flag direct batch subtraction that bypasses wallet safeguards.
|
|
100
101
|
18. Separate reservation from capture. Model reserved, captured, released, failed, expired, cancelled, and partially refunded states when credits are held before final purchase, fulfillment, or external payment completion.
|
|
102
|
+
- This ledger owns atomic reserve, capture, and release and the balance invariant. Commands and durable workflows may consume those operations but must not redefine balance availability, ownership, or accounting transitions.
|
|
101
103
|
19. Draw allowed state transitions. Prevent arbitrary `status = REFUNDED`, `status = CAPTURED`, or `status = EXPIRED` writes. Each transition should have a guard, cause, effect, and idempotency rule.
|
|
102
104
|
20. Preserve queue ordering or tolerate reordering. If deduction, cancellation, refund, or expiry events use a queue, prove user, wallet, or transaction-level ordering, or make each consumer robust to reordered events.
|
|
103
105
|
21. Treat message redelivery as normal. Producers, queues, schedulers, and webhooks can duplicate events. Consumer-side ledger mutation must be idempotent with durable dedupe records.
|
|
@@ -117,6 +119,7 @@ Review credit, point, and wallet balance code as an accounting ledger, not a bal
|
|
|
117
119
|
- The credit surface has balance, ledger-entry, source identity, atomicity, amount/unit, ownership, expiry/lot, reservation, queue/cache, audit, and reconciliation maps.
|
|
118
120
|
- Any mutable-balance-only path, missing source key, weak idempotency comparison, non-atomic deduction, wrong lock target, float amount, hidden rounding policy, missing DB invariant, duplicate ledger risk, generic refund, expiry race, cache-trusted deduction, stale replica read, unaudited admin adjustment, or missing reconciliation is fixed or reported with evidence.
|
|
119
121
|
- Tests or explicit verification cover the highest-risk concurrency, failure, duplicate, expiry, reservation, refund, cache, and reconciliation paths available in the current scope.
|
|
122
|
+
- Soft operational budgets remain outside this ledger unless they represent prepaid or money-equivalent value.
|
|
120
123
|
|
|
121
124
|
<!-- mustflow-section: verification -->
|
|
122
125
|
## Verification
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.dual-write-consistency
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: dual-write-consistency
|
|
9
|
+
description: Apply this skill when one logical operation changes durable state and separately publishes, projects, calls, or writes to another independently committed system, including database-plus-broker outbox or inbox flows, CDC, relay workers, event application ledgers, split outcomes, eventual convergence, reconciliation, and crash-point verification.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.dual-write-consistency
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- lint
|
|
19
|
+
- build
|
|
20
|
+
- test_related
|
|
21
|
+
- test
|
|
22
|
+
- test_audit
|
|
23
|
+
- docs_validate_fast
|
|
24
|
+
- test_release
|
|
25
|
+
- mustflow_check
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Dual Write Consistency
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: purpose -->
|
|
31
|
+
## Purpose
|
|
32
|
+
|
|
33
|
+
Keep one logical result truthful when it crosses independently committed databases, brokers,
|
|
34
|
+
indexes, files, or providers. Own the delivery and convergence protocol; do not pretend two commits
|
|
35
|
+
are one transaction or that broker delivery alone proves business convergence.
|
|
36
|
+
|
|
37
|
+
<!-- mustflow-section: use-when -->
|
|
38
|
+
## Use When
|
|
39
|
+
|
|
40
|
+
- A durable mutation and an event publish, projection update, webhook, provider mutation, or second
|
|
41
|
+
store write belong to one logical outcome but cannot commit atomically.
|
|
42
|
+
- Code introduces an outbox, inbox, relay, CDC stream, publisher claim, applied-event ledger,
|
|
43
|
+
reconciliation worker, or eventual-convergence claim.
|
|
44
|
+
- The path can crash between local commit, publish acceptance, publish recording, consumer effect,
|
|
45
|
+
consumer commit, and broker acknowledgement.
|
|
46
|
+
|
|
47
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
48
|
+
## Do Not Use When
|
|
49
|
+
|
|
50
|
+
- One database transaction with no independent commit boundary owns the whole invariant; use
|
|
51
|
+
`transaction-boundary-integrity-review`.
|
|
52
|
+
- The main failure is one logical request repeating; use `idempotency-integrity-review`.
|
|
53
|
+
- The main failure is broker acknowledgement, visibility, prefetch, poison-message, or DLQ behavior;
|
|
54
|
+
use `queue-processing-integrity-review`.
|
|
55
|
+
- The path is an old/new schema migration dual-write; use `migration-safety-check`.
|
|
56
|
+
- The path is a multi-step resumable saga with waits or compensation; use
|
|
57
|
+
`durable-workflow-orchestration`.
|
|
58
|
+
- Two writes happen in one local transaction, such as an order row and its audit row. That is not a
|
|
59
|
+
dual write merely because two tables changed.
|
|
60
|
+
|
|
61
|
+
<!-- mustflow-section: required-inputs -->
|
|
62
|
+
## Required Inputs
|
|
63
|
+
|
|
64
|
+
- Consistency-surface ledger: authoritative mutation, derived destinations, and every independent
|
|
65
|
+
commit boundary.
|
|
66
|
+
- Identity ledger: operation, event, causation, correlation, aggregate, ordering, payload hash, and
|
|
67
|
+
schema-version identities.
|
|
68
|
+
- Outbox and inbox ledger: unique keys, states, owner, claim lease, attempts, timestamps, and stale
|
|
69
|
+
claim recovery.
|
|
70
|
+
- Delivery ledger: producer confirmation, consumer transaction, acknowledgement position,
|
|
71
|
+
duplication, ordering, and redelivery contract.
|
|
72
|
+
- Convergence ledger: acceptable lag, drift detector, reconciliation owner, repair direction, and
|
|
73
|
+
operator-visible terminal or unresolved state.
|
|
74
|
+
- Failure-injection ledger: expected durable state after every crash boundary.
|
|
75
|
+
|
|
76
|
+
<!-- mustflow-section: preconditions -->
|
|
77
|
+
## Preconditions
|
|
78
|
+
|
|
79
|
+
- Read the nearest instructions, command contract, source-of-truth model, producer, consumer,
|
|
80
|
+
persistence schema, and retry or replay paths.
|
|
81
|
+
- Name one authoritative fact and every derived fact. If authority is peer-to-peer or bidirectional,
|
|
82
|
+
define conflict resolution before implementation.
|
|
83
|
+
- Treat provider, broker, and database guarantees as unverified until matched to the configured
|
|
84
|
+
code path and current deployment contract.
|
|
85
|
+
|
|
86
|
+
<!-- mustflow-section: allowed-edits -->
|
|
87
|
+
## Allowed Edits
|
|
88
|
+
|
|
89
|
+
- Add or tighten outbox, inbox, applied-event, relay-claim, delivery-state, drift-detection,
|
|
90
|
+
reconciliation, repair-command, and focused crash-injection surfaces.
|
|
91
|
+
- Synchronize event envelopes, schemas, migrations, tests, docs, metrics, and templates that own the
|
|
92
|
+
same convergence contract.
|
|
93
|
+
- Do not hide split outcomes behind a broad transaction wrapper, memory-only flag, best-effort log,
|
|
94
|
+
or broker exactly-once marketing claim.
|
|
95
|
+
|
|
96
|
+
<!-- mustflow-section: procedure -->
|
|
97
|
+
## Procedure
|
|
98
|
+
|
|
99
|
+
1. Draw the logical operation and every independent commit boundary.
|
|
100
|
+
2. Choose the source of truth and label each destination authoritative, derived, cached, indexed,
|
|
101
|
+
externally owned, or observational.
|
|
102
|
+
3. Put the authoritative mutation and outgoing intent record in one local transaction when that
|
|
103
|
+
store supports it. If not, name the unavoidable gap and repair protocol.
|
|
104
|
+
4. Give each logical event a stable ID, causation ID, correlation ID, aggregate or ordering key,
|
|
105
|
+
payload hash, and schema version required by its consumers.
|
|
106
|
+
5. Make relay claims durable and bounded. Record owner, lease or generation, attempt, next eligible
|
|
107
|
+
time, and stale-claim recovery; a process-local lock is not ownership proof.
|
|
108
|
+
6. Treat a crash after publish but before publish-success recording as duplicate-possible. Resume by
|
|
109
|
+
identity and confirmation or reconciliation, not by assuming the publish failed.
|
|
110
|
+
7. Put the consumer inbox or applied-event unique constraint and irreversible business effect in one
|
|
111
|
+
transaction when possible. An application-level `if exists` is not durable uniqueness.
|
|
112
|
+
8. Separate per-aggregate ordering from globally unordered delivery. Reject or defer stale events
|
|
113
|
+
when state depends on sequence; make commutative consumers explicit when order is irrelevant.
|
|
114
|
+
9. Preserve original identity through poison classification, schema rejection, DLQ transfer, and
|
|
115
|
+
replay. A replay creates a new attempt, not a new logical event.
|
|
116
|
+
10. Define reconciliation for missing, duplicate, stale, unknown, and divergent states. State which
|
|
117
|
+
side wins, which repair command runs, who approves destructive repair, and how convergence is
|
|
118
|
+
rechecked.
|
|
119
|
+
- This skill owns delivery, consumer-application, and projection convergence across independent
|
|
120
|
+
commits. Route workflow-step, terminal-state, and compensation-state recovery to
|
|
121
|
+
`durable-workflow-orchestration`.
|
|
122
|
+
11. Distinguish transport settlement, consumer commit, business convergence, and operator closure.
|
|
123
|
+
Do not report one as proof of the next.
|
|
124
|
+
12. Inject crashes after local commit, before and after publish, after consumer effect, after consumer
|
|
125
|
+
commit, and before acknowledgement. Also test duplicate, reordered, poison, stale-lease, and DLQ
|
|
126
|
+
replay paths.
|
|
127
|
+
|
|
128
|
+
<!-- mustflow-section: postconditions -->
|
|
129
|
+
## Postconditions
|
|
130
|
+
|
|
131
|
+
- Every crash point leaves the operation durably pending, duplicate-safe, reconciliable, or
|
|
132
|
+
explicitly unresolved; no state silently disappears.
|
|
133
|
+
- Relay and consumer ownership, event application, and repair are protected by durable identities,
|
|
134
|
+
constraints, leases or generations, and bounded retries.
|
|
135
|
+
- Outbox-only implementations do not claim completion without consumer duplicate control and a
|
|
136
|
+
reconciliation story.
|
|
137
|
+
- Evidence distinguishes local commit, delivery, application, convergence, and closure.
|
|
138
|
+
|
|
139
|
+
<!-- mustflow-section: verification -->
|
|
140
|
+
## Verification
|
|
141
|
+
|
|
142
|
+
- Use configured `changes_status` and `changes_diff_summary` for scope evidence.
|
|
143
|
+
- Use `lint`, `build`, and `test_related` for changed implementation and focused crash paths; use
|
|
144
|
+
`test` or `test_audit` when shared reliability coverage or test claims require it.
|
|
145
|
+
- Use `docs_validate_fast`, `test_release`, and `mustflow_check` when contracts, templates, package
|
|
146
|
+
output, or Mustflow surfaces change.
|
|
147
|
+
- Record unavailable broker, multi-process, chaos, or live-provider evidence instead of inventing
|
|
148
|
+
commands or approving a static claim as runtime proof.
|
|
149
|
+
|
|
150
|
+
<!-- mustflow-section: failure-handling -->
|
|
151
|
+
## Failure Handling
|
|
152
|
+
|
|
153
|
+
- If the source of truth or repair direction is unknown, stop convergence edits and report the
|
|
154
|
+
conflicting authorities.
|
|
155
|
+
- If one split outcome cannot be detected, preserve it as an explicit unknown state and add an
|
|
156
|
+
operator repair boundary before claiming safety.
|
|
157
|
+
- If an implementation relies only on an outbox, broker exactly-once mode, Redis TTL, logs, or an
|
|
158
|
+
application check, report the missing durable consumer or reconciliation proof.
|
|
159
|
+
- If verification fails, preserve the crash point and invariant, then use `failure-triage` before
|
|
160
|
+
broadening the change.
|
|
161
|
+
|
|
162
|
+
<!-- mustflow-section: output-format -->
|
|
163
|
+
## Output Format
|
|
164
|
+
|
|
165
|
+
- Logical operation, source of truth, and independent commit boundaries
|
|
166
|
+
- Event identity, outbox, relay, inbox, ordering, settlement, and convergence decisions
|
|
167
|
+
- Crash, duplicate, stale-owner, poison, replay, and reconciliation evidence
|
|
168
|
+
- Files changed and compatibility impact
|
|
169
|
+
- Command intents run, skipped checks, and reasons
|
|
170
|
+
- Remaining split-brain or convergence risk
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.durable-workflow-orchestration
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: durable-workflow-orchestration
|
|
9
|
+
description: Apply this skill when one business outcome spans multiple commands, persisted entities, services, callbacks, timers, approvals, retries, or compensations and must resume after process loss or deployment through a versioned durable workflow instance.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.durable-workflow-orchestration
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- lint
|
|
19
|
+
- build
|
|
20
|
+
- test_related
|
|
21
|
+
- test
|
|
22
|
+
- test_audit
|
|
23
|
+
- docs_validate_fast
|
|
24
|
+
- test_release
|
|
25
|
+
- mustflow_check
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Durable Workflow Orchestration
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: purpose -->
|
|
31
|
+
## Purpose
|
|
32
|
+
|
|
33
|
+
Own long-running progress across several transaction and resource boundaries. Make workflow state,
|
|
34
|
+
waits, retries, compensation, forward recovery, resume compatibility, and operator intervention
|
|
35
|
+
durable without pretending external effects can be rolled back like one database transaction.
|
|
36
|
+
|
|
37
|
+
<!-- mustflow-section: use-when -->
|
|
38
|
+
## Use When
|
|
39
|
+
|
|
40
|
+
- One business goal crosses two or more commands, persisted entities, services, or providers.
|
|
41
|
+
- The flow waits for callbacks, timers, approvals, retries, leases, or human intervention.
|
|
42
|
+
- A process restart or deployment must resume the exact safe step without repeating completed
|
|
43
|
+
external effects.
|
|
44
|
+
- The design uses a saga, process manager, workflow instance, durable checkpoint, compensation, or
|
|
45
|
+
manual-recovery state.
|
|
46
|
+
|
|
47
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
48
|
+
## Do Not Use When
|
|
49
|
+
|
|
50
|
+
- One accepted intent and local commit boundary is the whole operation; use `command-pattern`.
|
|
51
|
+
- One entity transition table owns the lifecycle; use `state-machine-pattern`.
|
|
52
|
+
- The main failure is a database-and-publish split; use `dual-write-consistency`.
|
|
53
|
+
- The main failure is queue settlement, duplicate logical delivery, or child-task lifetime; use
|
|
54
|
+
`queue-processing-integrity-review`, `idempotency-integrity-review`, or
|
|
55
|
+
`structured-concurrency-supervision-review` respectively.
|
|
56
|
+
- LLM autonomy, tool choice, or approval of model-directed work is the main concern; use
|
|
57
|
+
`agent-execution-control-review` and apply this skill only to the durable workflow underneath it.
|
|
58
|
+
- An order with one local `PENDING -> PAID -> SHIPPED` transition table is not automatically a
|
|
59
|
+
durable workflow. A callback-driven payment and fulfillment process across checkpoints is.
|
|
60
|
+
|
|
61
|
+
<!-- mustflow-section: required-inputs -->
|
|
62
|
+
## Required Inputs
|
|
63
|
+
|
|
64
|
+
- Workflow identity and definition-version ledger.
|
|
65
|
+
- Step ledger: input snapshot, command ID, dependency, deadline, attempt, owner, allowed next events,
|
|
66
|
+
and durable completion evidence.
|
|
67
|
+
- Effect classification ledger: `reversible`, `compensatable`, `forward-recovery-only`, or
|
|
68
|
+
`manual-intervention`.
|
|
69
|
+
- Checkpoint and resume-compatibility ledger for code, state schema, configuration, and policy.
|
|
70
|
+
- Compensation ledger linking each compensating command to its original effect and idempotency key.
|
|
71
|
+
- Timer, lease, cancellation, late-event, terminal-state, and reconciliation ledgers.
|
|
72
|
+
|
|
73
|
+
<!-- mustflow-section: preconditions -->
|
|
74
|
+
## Preconditions
|
|
75
|
+
|
|
76
|
+
- Read the nearest instructions, command contract, participating commands and state machines,
|
|
77
|
+
persistence model, queue or timer path, external effects, operator tools, and current tests.
|
|
78
|
+
- Name the business outcome and every independently owned participant before designing the workflow.
|
|
79
|
+
- Treat a compensation as a new effect with its own failure modes, never as time reversal.
|
|
80
|
+
|
|
81
|
+
<!-- mustflow-section: allowed-edits -->
|
|
82
|
+
## Allowed Edits
|
|
83
|
+
|
|
84
|
+
- Add or tighten workflow instances, step records, checkpoints, timers, leases, compensation
|
|
85
|
+
commands, resume compatibility, cancellation, manual-intervention, reconciliation, tests, metrics,
|
|
86
|
+
docs, and directly synchronized templates.
|
|
87
|
+
- Keep individual command payloads and entity transition rules in their owning command and state
|
|
88
|
+
machine layers.
|
|
89
|
+
- Do not serialize arbitrary runtime objects, closures, clients, credentials, hidden reasoning, or
|
|
90
|
+
raw conversations as workflow state.
|
|
91
|
+
|
|
92
|
+
<!-- mustflow-section: procedure -->
|
|
93
|
+
## Procedure
|
|
94
|
+
|
|
95
|
+
1. State the business outcome and list each participant, transaction boundary, external effect, wait,
|
|
96
|
+
callback, timer, and operator decision.
|
|
97
|
+
2. Check whether one command or one entity state machine is sufficient. Do not introduce a durable
|
|
98
|
+
workflow for a local sequence that cannot survive or need process loss.
|
|
99
|
+
3. Create a stable workflow instance ID and pin the workflow definition, state schema, code,
|
|
100
|
+
configuration, and policy versions required for safe resume.
|
|
101
|
+
4. Record each step's normalized input snapshot, command identity, dependency, deadline, attempt,
|
|
102
|
+
owner, next permitted events, and durable completion evidence.
|
|
103
|
+
5. Persist step completion and the next durable work request atomically where possible. Route any
|
|
104
|
+
independent commit split through `dual-write-consistency`.
|
|
105
|
+
6. Classify every effect as reversible, compensatable, forward-recovery-only, or
|
|
106
|
+
manual-intervention. Do not label email, payment, published data, or external user-visible effects
|
|
107
|
+
rollback-safe without provider-specific proof.
|
|
108
|
+
7. Model compensation as a separate idempotent command tied to the original command, resource,
|
|
109
|
+
amount or scope, workflow instance, and reason. Give compensation its own retry and terminal state.
|
|
110
|
+
Use a distinct operation type and idempotency namespace or key for the compensation; never reuse
|
|
111
|
+
the original effect key without an explicit operation discriminator.
|
|
112
|
+
8. Store semantic workflow state and ledger positions in checkpoints. Rebuild runtime clients and
|
|
113
|
+
transient caches on resume instead of serializing them.
|
|
114
|
+
9. On resume, verify workflow definition, schema, code, configuration, and policy compatibility.
|
|
115
|
+
Migrate, continue under the pinned version, or stop for intervention; never guess through drift.
|
|
116
|
+
10. Fence stale owners and reject late callbacks, timers, or completions from an older workflow
|
|
117
|
+
generation or already-closed step.
|
|
118
|
+
11. Define cancellation separately from compensation. State which pending work stops, which accepted
|
|
119
|
+
external effects continue, which compensations start, and when cancellation becomes terminal.
|
|
120
|
+
12. Preserve partial completion and compensation failure as observable outcomes such as
|
|
121
|
+
`FORWARD_RECOVERY_REQUIRED` or `MANUAL_INTERVENTION`, not generic failure or false rollback.
|
|
122
|
+
13. Test restart before and after every step, duplicate and late completion, version drift, timer
|
|
123
|
+
expiry, stale owner, cancellation, compensation failure, reconciliation, and manual resume.
|
|
124
|
+
- This skill owns workflow-step, terminal-state, and compensation-state recovery. Route
|
|
125
|
+
delivery, consumer-application, and projection convergence across independent commits to
|
|
126
|
+
`dual-write-consistency`.
|
|
127
|
+
|
|
128
|
+
<!-- mustflow-section: postconditions -->
|
|
129
|
+
## Postconditions
|
|
130
|
+
|
|
131
|
+
- Every step has durable identity, owner, state, version, and completion evidence.
|
|
132
|
+
- Resume does not silently replay an already completed external effect.
|
|
133
|
+
- Every reachable branch terminates as succeeded, compensated, forward-recovery-required,
|
|
134
|
+
cancelled with declared residual effects, or manual-intervention.
|
|
135
|
+
- Workflow orchestration does not replace command, state-machine, delivery, ledger, or policy owners.
|
|
136
|
+
|
|
137
|
+
<!-- mustflow-section: verification -->
|
|
138
|
+
## Verification
|
|
139
|
+
|
|
140
|
+
- Use configured `changes_status` and `changes_diff_summary` for scope evidence.
|
|
141
|
+
- Use `lint`, `build`, and `test_related` for implementation and restart fixtures; use `test` or
|
|
142
|
+
`test_audit` when orchestration is shared or test coverage claims are broad.
|
|
143
|
+
- Use `docs_validate_fast`, `test_release`, and `mustflow_check` for public, package, template, or
|
|
144
|
+
Mustflow changes.
|
|
145
|
+
- Report unavailable multi-process, deployment-resume, clock, provider, or operator evidence rather
|
|
146
|
+
than replacing it with raw commands.
|
|
147
|
+
|
|
148
|
+
<!-- mustflow-section: failure-handling -->
|
|
149
|
+
## Failure Handling
|
|
150
|
+
|
|
151
|
+
- If participant ownership or compensation semantics are unknown, stop workflow expansion and list
|
|
152
|
+
the missing business decisions.
|
|
153
|
+
- If resume compatibility is unprovable, preserve the run under manual intervention rather than
|
|
154
|
+
loading it into new code optimistically.
|
|
155
|
+
- If compensation can fail without a terminal recovery path, report the workflow as incomplete.
|
|
156
|
+
- If a configured check fails, preserve the workflow state and failure boundary, then use
|
|
157
|
+
`failure-triage` before broadening the edit.
|
|
158
|
+
|
|
159
|
+
<!-- mustflow-section: output-format -->
|
|
160
|
+
## Output Format
|
|
161
|
+
|
|
162
|
+
- Workflow goal, instance identity, definition version, participants, and boundaries
|
|
163
|
+
- Step, checkpoint, timer, lease, cancellation, and resume decisions
|
|
164
|
+
- Effect classifications, compensation commands, and terminal outcomes
|
|
165
|
+
- Restart, duplicate, late-event, drift, compensation, and manual-recovery evidence
|
|
166
|
+
- Files changed and compatibility impact
|
|
167
|
+
- Command intents run, skipped checks, and remaining durable-workflow risk
|
package/templates/default/locales/en/.mustflow/skills/execution-ledger-integrity-review/SKILL.md
ADDED
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
---
|
|
2
|
+
mustflow_doc: skill.execution-ledger-integrity-review
|
|
3
|
+
locale: en
|
|
4
|
+
canonical: true
|
|
5
|
+
revision: 1
|
|
6
|
+
lifecycle: mustflow-owned
|
|
7
|
+
authority: procedure
|
|
8
|
+
name: execution-ledger-integrity-review
|
|
9
|
+
description: Apply this skill when runs, attempts, leases, approvals, checkpoints, tool or provider effects, receipts, terminal outcomes, resume, reconciliation, or replay depend on an append-only execution ledger rather than ordinary logs or session handoff summaries.
|
|
10
|
+
metadata:
|
|
11
|
+
mustflow_schema: "1"
|
|
12
|
+
mustflow_kind: procedure
|
|
13
|
+
pack_id: mustflow.core
|
|
14
|
+
skill_id: mustflow.core.execution-ledger-integrity-review
|
|
15
|
+
command_intents:
|
|
16
|
+
- changes_status
|
|
17
|
+
- changes_diff_summary
|
|
18
|
+
- lint
|
|
19
|
+
- build
|
|
20
|
+
- test_related
|
|
21
|
+
- test
|
|
22
|
+
- test_audit
|
|
23
|
+
- docs_validate_fast
|
|
24
|
+
- test_release
|
|
25
|
+
- mustflow_check
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Execution Ledger Integrity Review
|
|
29
|
+
|
|
30
|
+
<!-- mustflow-section: purpose -->
|
|
31
|
+
## Purpose
|
|
32
|
+
|
|
33
|
+
Keep execution history truthful enough to explain, resume, reconcile, and safely replay decisions.
|
|
34
|
+
Record observable inputs, actions, approvals, attempts, effects, checkpoints, and outcomes without
|
|
35
|
+
turning hidden reasoning, secrets, raw conversations, or full logs into durable authority.
|
|
36
|
+
|
|
37
|
+
<!-- mustflow-section: use-when -->
|
|
38
|
+
## Use When
|
|
39
|
+
|
|
40
|
+
- A system must later prove which run, attempt, lease owner, checkpoint, approval, effect, or terminal
|
|
41
|
+
outcome happened.
|
|
42
|
+
- Resume or reconciliation depends on an operation ledger, execution ledger, semantic checkpoint,
|
|
43
|
+
effect receipt, result digest, provenance, or replay record.
|
|
44
|
+
- A reliability claim depends on durable execution facts rather than ordinary trace or log lines.
|
|
45
|
+
|
|
46
|
+
<!-- mustflow-section: do-not-use-when -->
|
|
47
|
+
## Do Not Use When
|
|
48
|
+
|
|
49
|
+
- The task is ordinary logging or trace-field quality; use `backend-log-evidence-review` or
|
|
50
|
+
`observability-debuggability-review`.
|
|
51
|
+
- The record is a coding-session handoff; use `restricted-handoff-resume`.
|
|
52
|
+
- The record is a credit, payment, accounting, or business balance ledger; use the corresponding
|
|
53
|
+
ledger-integrity skill.
|
|
54
|
+
- The main concern is duplicate acceptance, workflow step order, compensation, or policy evaluation;
|
|
55
|
+
use `idempotency-integrity-review`, `durable-workflow-orchestration`, or
|
|
56
|
+
`policy-decision-integrity-review` respectively.
|
|
57
|
+
- A request ID in logs is not an execution ledger, and an idempotency key alone does not prove which
|
|
58
|
+
attempt performed an external effect.
|
|
59
|
+
|
|
60
|
+
<!-- mustflow-section: required-inputs -->
|
|
61
|
+
## Required Inputs
|
|
62
|
+
|
|
63
|
+
- Execution identity ledger: run, parent run, logical action, attempt, causation, and correlation.
|
|
64
|
+
- Input and version ledger: safe input digest plus code, configuration, policy, model, provider,
|
|
65
|
+
tool, and schema versions required to interpret the result.
|
|
66
|
+
- Action and effect ledger: selected action, safe argument digest, approval, effect identity, and
|
|
67
|
+
pre-effect intent record.
|
|
68
|
+
- Attempt and outcome ledger: owner or lease, start, result digest, receipt, unknown or partial
|
|
69
|
+
outcome, terminal classification, and supersession.
|
|
70
|
+
- Checkpoint, integrity, retention, privacy, replay, and reconciliation ledgers.
|
|
71
|
+
|
|
72
|
+
<!-- mustflow-section: preconditions -->
|
|
73
|
+
## Preconditions
|
|
74
|
+
|
|
75
|
+
- Read the nearest instructions, command contract, execution path, persistence schema, checkpoint
|
|
76
|
+
and resume code, effect boundaries, privacy policy, replay path, and current tests.
|
|
77
|
+
- Separate audit, resume, reconciliation, and replay requirements. Do not add an event-sourced domain
|
|
78
|
+
model when only execution evidence is needed.
|
|
79
|
+
- Treat stored summaries and traces as derived evidence below current source, policy, and durable
|
|
80
|
+
receipts.
|
|
81
|
+
|
|
82
|
+
<!-- mustflow-section: allowed-edits -->
|
|
83
|
+
## Allowed Edits
|
|
84
|
+
|
|
85
|
+
- Add or tighten execution identities, append-only entries, sequence or hash links, lease generations,
|
|
86
|
+
semantic checkpoints, effect receipts, terminal outcomes, replay inputs, reconciliation, retention,
|
|
87
|
+
redaction, focused tests, docs, and directly synchronized templates.
|
|
88
|
+
- Add public projections or exports only with their owning public-contract procedure.
|
|
89
|
+
- Do not store hidden reasoning, raw prompts, raw conversations, full terminal output, credentials,
|
|
90
|
+
secret-bearing tool payloads, or unbounded provider responses as ledger evidence.
|
|
91
|
+
|
|
92
|
+
<!-- mustflow-section: procedure -->
|
|
93
|
+
## Procedure
|
|
94
|
+
|
|
95
|
+
1. State whether the ledger supports audit, resume, reconciliation, replay, or a bounded combination.
|
|
96
|
+
2. Define stable run, parent, logical action, attempt, causation, correlation, approval, and effect
|
|
97
|
+
identities. Do not collapse a retry attempt into a new logical action.
|
|
98
|
+
3. Record safe input digests and every code, configuration, policy, model, provider, tool, and schema
|
|
99
|
+
version needed to interpret the decision and result.
|
|
100
|
+
4. Keep model, provider, and tool content minimal: safe normalized fields, evidence pointers, and
|
|
101
|
+
digests. Redact or omit raw sensitive payloads before persistence.
|
|
102
|
+
5. Bind approval to the exact actor, resource, action, arguments or digest, policy decision, version,
|
|
103
|
+
expiry, and effect that it permits.
|
|
104
|
+
6. Append an accepted intent before an external effect and append the observed outcome afterward.
|
|
105
|
+
Preserve a gap or unknown outcome if the process dies between them.
|
|
106
|
+
7. Separate logical action state from attempts. Record owner, lease or generation, attempt number,
|
|
107
|
+
deadline, retry reason, supersession, and the terminal attempt that owns the outcome.
|
|
108
|
+
8. Treat timeout or missing response as unknown, not failed, until provider lookup, durable receipt,
|
|
109
|
+
or reconciliation establishes the result.
|
|
110
|
+
9. Store semantic state and the last committed ledger position in a checkpoint. Reconstruct runtime
|
|
111
|
+
objects and verify pending effects on resume.
|
|
112
|
+
10. Enforce append-only ordering with unique identities, monotonic sequence or equivalent causal
|
|
113
|
+
links, durable constraints, and tamper or truncation detection appropriate to the threat model.
|
|
114
|
+
11. Make terminal outcomes monotonic. A late attempt cannot overwrite a succeeded, cancelled,
|
|
115
|
+
superseded, or manual-review result without an explicit corrective entry.
|
|
116
|
+
12. Replay pure decisions against pinned inputs and inject recorded observations for external calls.
|
|
117
|
+
Never make replay re-send email, charge money, mutate providers, or publish events implicitly.
|
|
118
|
+
13. Test missing entries, partial append, duplicate outcome, stale lease, late attempt, version drift,
|
|
119
|
+
unknown provider result, checkpoint gap, tampering, retention expiry, and replay side-effect blocks.
|
|
120
|
+
|
|
121
|
+
<!-- mustflow-section: postconditions -->
|
|
122
|
+
## Postconditions
|
|
123
|
+
|
|
124
|
+
- Every observable effect links to a logical action, attempt, owner, approval when required, and
|
|
125
|
+
result or explicit unknown outcome.
|
|
126
|
+
- Resume cannot skip a ledger gap, stale lease, version mismatch, or unresolved effect silently.
|
|
127
|
+
- Replay does not execute external mutations and reports version drift instead of false equivalence.
|
|
128
|
+
- Retained evidence is bounded and privacy-safe without relying on hidden reasoning or raw logs.
|
|
129
|
+
|
|
130
|
+
<!-- mustflow-section: verification -->
|
|
131
|
+
## Verification
|
|
132
|
+
|
|
133
|
+
- Use configured `changes_status` and `changes_diff_summary` for scope evidence.
|
|
134
|
+
- Use `lint`, `build`, and `test_related` for implementation and ledger failure fixtures; use `test`
|
|
135
|
+
or `test_audit` for shared ledger or coverage claims.
|
|
136
|
+
- Use `docs_validate_fast`, `test_release`, and `mustflow_check` for public exports, package, template,
|
|
137
|
+
or Mustflow changes.
|
|
138
|
+
- Report unavailable database fault injection, provider reconciliation, tamper testing, or retention
|
|
139
|
+
expiry evidence rather than inventing commands.
|
|
140
|
+
|
|
141
|
+
<!-- mustflow-section: failure-handling -->
|
|
142
|
+
## Failure Handling
|
|
143
|
+
|
|
144
|
+
- If run, action, attempt, or effect identity cannot be separated, stop replay or resume claims and
|
|
145
|
+
report the ambiguous identity.
|
|
146
|
+
- If a ledger gap or unknown effect cannot be reconciled, preserve manual-review state; do not mark
|
|
147
|
+
the run failed and retry automatically.
|
|
148
|
+
- If safe evidence requires storing secrets or raw transcripts, redesign the evidence pointer or
|
|
149
|
+
digest before persistence.
|
|
150
|
+
- If verification fails, preserve the ledger invariant and use `failure-triage` before changing
|
|
151
|
+
unrelated runtime code.
|
|
152
|
+
|
|
153
|
+
<!-- mustflow-section: output-format -->
|
|
154
|
+
## Output Format
|
|
155
|
+
|
|
156
|
+
- Audit, resume, reconciliation, and replay purposes reviewed
|
|
157
|
+
- Run, action, attempt, version, approval, effect, checkpoint, and terminal-outcome decisions
|
|
158
|
+
- Append-only, privacy, retention, unknown-outcome, and replay protections
|
|
159
|
+
- Failure-injection and drift evidence
|
|
160
|
+
- Files changed and public-contract impact
|
|
161
|
+
- Command intents run, skipped checks, and remaining ledger-integrity risk
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skill.idempotency-integrity-review
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 2
|
|
6
6
|
lifecycle: mustflow-owned
|
|
7
7
|
authority: procedure
|
|
8
8
|
name: idempotency-integrity-review
|
|
@@ -50,6 +50,8 @@ The review question is not "is this POST protected?" It is "if the same business
|
|
|
50
50
|
- The task is primarily stale shared state, lock scope, or generic interleaving with no duplicate logical operation or retry surface; use `race-condition-review` or `concurrency-invariant-review`.
|
|
51
51
|
- The task is primarily swallowed failures, false success, timeout honesty, queue ack/nack honesty, fallback defaults, or public error contracts; use `failure-integrity-review`.
|
|
52
52
|
- The operation is a pure read with no hidden write, usage charge, read receipt, analytics commitment, cache mutation that matters, external call, or durable side effect.
|
|
53
|
+
- The main failure is divergence after two systems can commit independently; use `dual-write-consistency` first. Keep duplicate delivery and duplicate intent handling here.
|
|
54
|
+
- The main failure is a lying or incomplete run, attempt, checkpoint, or effect receipt; use `execution-ledger-integrity-review`.
|
|
53
55
|
|
|
54
56
|
<!-- mustflow-section: required-inputs -->
|
|
55
57
|
## Required Inputs
|
|
@@ -133,9 +135,9 @@ The review question is not "is this POST protected?" It is "if the same business
|
|
|
133
135
|
- Use business keys such as `settlement_date + merchant_id`, `campaign_id + user_id`, import file row identity, period key, or run source ID instead of loose "already processed yesterday" checks.
|
|
134
136
|
16. Review outbox and inbox pairing.
|
|
135
137
|
- DB change plus message publish can split when either side succeeds alone.
|
|
136
|
-
-
|
|
138
|
+
- Route the convergence protocol for independently committed effects to `dual-write-consistency`. Keep inbox, applied-event, and duplicate-delivery handling in this skill.
|
|
137
139
|
17. Review saga compensation.
|
|
138
|
-
- Compensation actions such as cancel, refund, release stock, revoke entitlement, or restore credits
|
|
140
|
+
- Route compensation order and resumable saga state to `durable-workflow-orchestration`. Compensation actions such as cancel, refund, release stock, revoke entitlement, or restore credits still need idempotency keys tied to the original action here.
|
|
139
141
|
- Double compensation can be worse than the original failure.
|
|
140
142
|
18. Review `PROCESSING` and lease recovery.
|
|
141
143
|
- A `PROCESSING` row without lease, heartbeat, timeout, owner, or reconciliation can permanently block retries after a crash.
|
package/templates/default/locales/en/.mustflow/skills/llm-token-cost-control-review/SKILL.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skill.llm-token-cost-control-review
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 5
|
|
6
6
|
lifecycle: mustflow-owned
|
|
7
7
|
authority: procedure
|
|
8
8
|
name: llm-token-cost-control-review
|
|
@@ -50,6 +50,9 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
|
|
|
50
50
|
- The main risk is cloud account, infrastructure, SaaS, quota, budget, tag, retention, or provider-account spend guardrails outside the model-call payload; use `cloud-cost-guardrail-review`.
|
|
51
51
|
- The main risk is rate-limit fairness, throttling, quota counters, concurrency limits, 429 response behavior, or protected-resource definition; use `rate-limit-integrity-review`.
|
|
52
52
|
- The task only edits user-visible copy and does not affect LLM payload, model choice, retry behavior, or cost telemetry.
|
|
53
|
+
- The budget is prepaid, stored-value, or money-equivalent credit with reserve, capture, and release accounting; use `credit-ledger-integrity-review`.
|
|
54
|
+
- The main contract is provenance for allow, block, downgrade, limit, or obligation decisions; use `policy-decision-integrity-review`.
|
|
55
|
+
- The main contract is accepted-work reservation persistence; use `command-pattern`. This skill owns token estimates, caps, and cost-per-success evidence.
|
|
53
56
|
|
|
54
57
|
<!-- mustflow-section: required-inputs -->
|
|
55
58
|
## Required Inputs
|
|
@@ -67,6 +70,7 @@ Review LLM cost as a product and systems contract, not as prompt brevity. A cost
|
|
|
67
70
|
- Output ledger: output schema size, repeated key length, patch versus full-output policy, `max_output_tokens`, reasoning budget, retry repair inputs, validator errors, and incomplete-response handling.
|
|
68
71
|
- Routing ledger: deterministic prefilters, small-model router, expensive-model escalation rule, batch or flex eligibility, predicted-output eligibility, image or file preprocessing, and fallback behavior.
|
|
69
72
|
- Observability ledger: input tokens, cached tokens when exposed by the provider, output tokens, reasoning tokens when exposed or billable, retry count, validation failure count, cache hit rate, cost per successful task, model, endpoint, prompt version, tool version, schema version, and budget breach events.
|
|
73
|
+
- Boundary ledger: token estimates and caps owned here; accepted-work reservation persistence owned by `command-pattern`; prepaid or money-equivalent reserve, capture, and release owned by `credit-ledger-integrity-review`; allow, block, downgrade, and obligation provenance owned by `policy-decision-integrity-review`.
|
|
70
74
|
|
|
71
75
|
<!-- mustflow-section: preconditions -->
|
|
72
76
|
## Preconditions
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
mustflow_doc: skill.migration-safety-check
|
|
3
3
|
locale: en
|
|
4
4
|
canonical: true
|
|
5
|
-
revision:
|
|
5
|
+
revision: 9
|
|
6
6
|
lifecycle: mustflow-owned
|
|
7
7
|
authority: procedure
|
|
8
8
|
name: migration-safety-check
|
|
@@ -44,6 +44,7 @@ Keep migrations reversible, scoped, and verified before they affect data, schema
|
|
|
44
44
|
- Documentation or final reports claim that backup, restore, cache rebuild, index rebuild, or analytics migration is safe, tested, repeatable, or complete.
|
|
45
45
|
- Documentation or final reports claim that a migration is safe, complete, reversible, idempotent, or already applied.
|
|
46
46
|
- A change could make older installed projects, existing lock files, generated files, caches, or user-edited documents incompatible.
|
|
47
|
+
- Persisted workflow, checkpoint, run, attempt, or execution-ledger schema versions need an old-to-new transformation while preserving in-flight data.
|
|
47
48
|
|
|
48
49
|
<!-- mustflow-section: do-not-use-when -->
|
|
49
50
|
## Do Not Use When
|
|
@@ -51,6 +52,7 @@ Keep migrations reversible, scoped, and verified before they affect data, schema
|
|
|
51
52
|
- The change is a small local refactor with no persisted, generated, installed, or user data surface.
|
|
52
53
|
- The task only edits inert documentation and makes no claim about applying or validating a migration.
|
|
53
54
|
- The migration would require live production access, destructive actions, or manual operator approval that is outside the current command contract.
|
|
55
|
+
- The task defines workflow progression, checkpoint semantics, compensation order, run truth, attempt truth, effect truth, or public JSON meaning. Use the owning workflow, execution-ledger, or public-contract skill; this skill owns only the old-to-new transformation.
|
|
54
56
|
|
|
55
57
|
<!-- mustflow-section: required-inputs -->
|
|
56
58
|
## Required Inputs
|
|
@@ -92,6 +94,7 @@ Keep migrations reversible, scoped, and verified before they affect data, schema
|
|
|
92
94
|
1. Identify the migration surface and classify it as code, schema, data, configuration, template, generated state, cache, package metadata, or documentation.
|
|
93
95
|
For content systems, also classify whether it touches inline page content, body files, frontmatter, lifecycle states, slug history, redirects, taxonomy, assets, facts, claims, sources, site exposure, search index, feeds, sitemaps, analytics events, exports, or public API projections.
|
|
94
96
|
2. Record the source state, target state, expected affected paths, and whether the change must support old and new states during transition.
|
|
97
|
+
- For persisted workflow, checkpoint, run, attempt, or execution-ledger versions, preserve identity, ownership, terminal-state meaning, and referential links while transforming old records to the new schema. Do not redefine workflow semantics or ledger truth in the migration.
|
|
95
98
|
- Prefer an expand, backfill, switch, and shrink sequence for live schema and API changes: add the new shape, support old and new reads or writes, migrate data, switch readers, then remove the old shape only after compatibility is proven.
|
|
96
99
|
- Treat rollback as more than `down` migration. Distinguish schema rollback, data rollback, app rollback, and operational restore. A `down` file does not recover deleted or overwritten data unless the original values were preserved.
|
|
97
100
|
- Prefer forward-only recovery for live systems: if a change fails after partial application, use a corrective migration or compatibility patch unless a tested restore path proves a rewind is safer.
|