mustflow 2.116.1 → 2.116.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/package.json +1 -1
  2. package/templates/default/i18n.toml +72 -6
  3. package/templates/default/locales/en/.mustflow/skills/INDEX.md +37 -11
  4. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/SKILL.md +477 -0
  5. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-diagnostics-abi-linker-checklist.md +778 -0
  6. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-generators-properties-checklist.md +501 -0
  7. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/compiler-test-strategy-differential-checklist.md +498 -0
  8. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/debug-symbol-symbolication-checklist.md +412 -0
  9. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/ir-design-ssa-pass-pipeline-checklist.md +759 -0
  10. package/templates/default/locales/en/.mustflow/skills/compiler-engineering-review/references/miscompile-reduction-ir-checklist.md +434 -0
  11. package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/SKILL.md +55 -36
  12. package/templates/default/locales/en/.mustflow/skills/cross-platform-filesystem-safety/references/path-containment-handle-checklist.md +251 -0
  13. package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/SKILL.md +133 -32
  14. package/templates/default/locales/en/.mustflow/skills/file-upload-security-review/references/file-upload-parser-ssrf-resource-checklist.md +306 -0
  15. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/SKILL.md +310 -0
  16. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-concurrency-model-checking-smt-checklist.md +457 -0
  17. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-contracts-modeling-checklist.md +434 -0
  18. package/templates/default/locales/en/.mustflow/skills/formal-verification-review/references/formal-memory-bounds-ci-checklist.md +509 -0
  19. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/SKILL.md +439 -0
  20. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-harness-campaign-checklist.md +379 -0
  21. package/templates/default/locales/en/.mustflow/skills/fuzz-harness-review/references/fuzz-oracle-triage-ci-checklist.md +307 -0
  22. package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/SKILL.md +48 -28
  23. package/templates/default/locales/en/.mustflow/skills/idempotency-integrity-review/references/operation-ordering-stale-write-checklist.md +259 -0
  24. package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/SKILL.md +329 -0
  25. package/templates/default/locales/en/.mustflow/skills/input-boundary-validation-review/references/input-boundary-security-checklist.md +319 -0
  26. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/SKILL.md +306 -0
  27. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/input-session-state-checklist.md +298 -0
  28. package/templates/default/locales/en/.mustflow/skills/input-event-synchronization-review/references/remote-input-transport-interaction-checklist.md +328 -0
  29. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/SKILL.md +353 -0
  30. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-diagnostics-recovery-checklist.md +267 -0
  31. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-execution-closure-performance-checklist.md +428 -0
  32. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-gc-verification-checklist.md +457 -0
  33. package/templates/default/locales/en/.mustflow/skills/interpreter-engineering-review/references/interpreter-semantics-runtime-checklist.md +391 -0
  34. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/SKILL.md +294 -0
  35. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/modal-loop-reentrancy-checklist.md +290 -0
  36. package/templates/default/locales/en/.mustflow/skills/modal-loop-reentrancy-review/references/nested-modal-state-lifetime-checklist.md +297 -0
  37. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/SKILL.md +252 -0
  38. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/dns-network-resolution-checklist.md +394 -0
  39. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/language-symbol-resolution-checklist.md +282 -0
  40. package/templates/default/locales/en/.mustflow/skills/name-resolution-integrity-review/references/module-package-loader-resolution-checklist.md +352 -0
  41. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/SKILL.md +103 -17
  42. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/cst-ast-lowering-checklist.md +260 -0
  43. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/lexer-tokenization-checklist.md +397 -0
  44. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-serialization-compatibility-checklist.md +164 -0
  45. package/templates/default/locales/en/.mustflow/skills/parser-engineering-review/references/tree-traversal-rewrite-checklist.md +209 -0
  46. package/templates/default/locales/en/.mustflow/skills/race-condition-review/SKILL.md +68 -11
  47. package/templates/default/locales/en/.mustflow/skills/race-condition-review/references/race-reproduction-memory-model-checklist.md +268 -0
  48. package/templates/default/locales/en/.mustflow/skills/routes.toml +151 -0
  49. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/SKILL.md +343 -0
  50. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-auth-stream-resume-checklist.md +413 -0
  51. package/templates/default/locales/en/.mustflow/skills/session-handoff-integrity-review/references/session-handoff-protocol-checklist.md +485 -0
  52. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/SKILL.md +267 -0
  53. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/admission-decision-recovery-checklist.md +308 -0
  54. package/templates/default/locales/en/.mustflow/skills/two-phase-transition-integrity-review/references/two-phase-transition-checklist.md +229 -0
  55. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/SKILL.md +300 -0
  56. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-affinity-event-loop-checklist.md +277 -0
  57. package/templates/default/locales/en/.mustflow/skills/ui-dispatch-lifecycle-review/references/ui-dispatch-lifecycle-checklist.md +292 -0
  58. package/templates/default/manifest.toml +115 -1
@@ -0,0 +1,457 @@
1
+ # Formal Concurrency, Model Checking, and SMT Checklist
2
+
3
+ Use this checklist when formal evidence depends on concurrent histories, adversarial schedules,
4
+ failure and recovery behavior, state-space reduction, refinement, model-based testing, or an SMT
5
+ encoding of executable semantics.
6
+
7
+ ## Contents
8
+
9
+ 1. [Property layers](#property-layers)
10
+ 2. [Inductive safety obligations](#inductive-safety-obligations)
11
+ 3. [Trace histories and linearizability](#trace-histories-and-linearizability)
12
+ 4. [Refinement and stuttering](#refinement-and-stuttering)
13
+ 5. [Abstraction direction](#abstraction-direction)
14
+ 6. [Adversarial nondeterminism](#adversarial-nondeterminism)
15
+ 7. [Atomicity claims](#atomicity-claims)
16
+ 8. [Deadlock livelock and starvation](#deadlock-livelock-and-starvation)
17
+ 9. [Weak-memory boundary](#weak-memory-boundary)
18
+ 10. [Network and epoch behavior](#network-and-epoch-behavior)
19
+ 11. [Crash and recovery state](#crash-and-recovery-state)
20
+ 12. [Duplicate effects and result replay](#duplicate-effects-and-result-replay)
21
+ 13. [Property-directed slicing](#property-directed-slicing)
22
+ 14. [Identity symmetry and role abstraction](#identity-symmetry-and-role-abstraction)
23
+ 15. [Partial-order and stateless exploration](#partial-order-and-stateless-exploration)
24
+ 16. [Reduction soundness](#reduction-soundness)
25
+ 17. [Bound ladders and lossy search](#bound-ladders-and-lossy-search)
26
+ 18. [Abstraction refinement and inductive strengthening](#abstraction-refinement-and-inductive-strengthening)
27
+ 19. [Compositional proof and cutoff claims](#compositional-proof-and-cutoff-claims)
28
+ 20. [Model-based test bridge](#model-based-test-bridge)
29
+ 21. [SMT result question](#smt-result-question)
30
+ 22. [Theory and representation selection](#theory-and-representation-selection)
31
+ 23. [SSA paths loops and memory](#ssa-paths-loops-and-memory)
32
+ 24. [Datatypes and uninterpreted functions](#datatypes-and-uninterpreted-functions)
33
+ 25. [Quantifiers triggers and incremental contexts](#quantifiers-triggers-and-incremental-contexts)
34
+ 26. [Unsat evidence and replay](#unsat-evidence-and-replay)
35
+ 27. [Failure matrix](#failure-matrix)
36
+ 28. [Invariants](#invariants)
37
+ 29. [Skill handoffs](#skill-handoffs)
38
+
39
+ ## Property layers
40
+
41
+ Separate the property by what it observes:
42
+
43
+ - a state property constrains one snapshot;
44
+ - an action property constrains one transition and its before-and-after values;
45
+ - a trace property constrains an event sequence or history;
46
+ - a relational property compares two executions, implementations, or versions;
47
+ - a hyperproperty constrains a set of traces rather than one trace in isolation.
48
+
49
+ Use a state invariant for conservation or exclusivity. Use an action invariant for matched deltas,
50
+ monotonic versions, or permitted mutations. Use a trace property for call-before-return ordering,
51
+ duplicate effects, revocation history, or information flow. Do not accept a safe final snapshot when
52
+ the path to that snapshot emitted a forbidden effect.
53
+
54
+ ## Inductive safety obligations
55
+
56
+ Prove a safety property through an inductive strengthening with three independent obligations:
57
+
58
+ 1. every permitted initial state satisfies the inductive invariant;
59
+ 2. every permitted transition preserves it;
60
+ 3. the inductive invariant implies the desired safety property.
61
+
62
+ The desired property may be true on reachable states without being inductive by itself. When the
63
+ preservation obligation produces an unreachable predecessor, identify the missing relationship among
64
+ owners, epochs, queues, logs, counters, or control states and strengthen the invariant. Do not hide
65
+ the gap by checking longer finite traces and calling the result unbounded.
66
+
67
+ ## Trace histories and linearizability
68
+
69
+ Record operation invocation, response, argument, result, actor, and real-time precedence in a
70
+ history when concurrent-object correctness is in scope.
71
+
72
+ For linearizability, require a legal sequential history that:
73
+
74
+ - contains the same completed operations and permitted treatment of pending operations;
75
+ - preserves the sequential specification;
76
+ - preserves real-time order for non-overlapping operations;
77
+ - explains return values and externally visible effects together.
78
+
79
+ Do not declare an internal compare-and-swap, commit, or enqueue instruction to be the linearization
80
+ point before the complete history is shown to refine the sequential specification. Use history or
81
+ prophecy state when the abstract effect depends on a later racing outcome, but prove that auxiliary
82
+ state does not restrict executable choices.
83
+
84
+ ## Refinement and stuttering
85
+
86
+ Define a map from concrete implementation state and events to abstract model state and actions.
87
+ Permit a concrete step to map to:
88
+
89
+ - one abstract action;
90
+ - an abstract stuttering step with no observable abstract change;
91
+ - a justified batch of abstract actions when the observation allows it.
92
+
93
+ Show how retries, failed compare-and-swap attempts, allocation, caches, buffering, background work,
94
+ and partial persistence map. Preserve externally visible order and effects. A many-step
95
+ implementation does not need to resemble the model structurally, but every permitted concrete trace
96
+ must have an allowed abstract explanation under the declared observation.
97
+
98
+ ## Abstraction direction
99
+
100
+ Classify each abstraction as over-approximating, under-approximating, or property-preserving.
101
+
102
+ For a safety proof, prefer an over-approximation that admits at least the relevant real behaviors.
103
+ A counterexample may then be spurious, but a complete proof over the wider behavior set covers the
104
+ concrete subset. Use an under-approximation for bug finding only unless a completeness argument
105
+ closes the missing behavior gap.
106
+
107
+ Record which distinctions were removed: identity, order, payload, time, failure count, resource
108
+ limit, arithmetic width, or memory behavior. Preserve every observation the property uses. If a
109
+ counterexample cannot be concretized, restore only the distinction needed to rule it out rather than
110
+ copying the entire implementation into the model.
111
+
112
+ ## Adversarial nondeterminism
113
+
114
+ Treat nondeterministic choice as an adversary over every behavior the contract permits, not as a
115
+ random sample.
116
+
117
+ Include relevant choices for:
118
+
119
+ - actor scheduling and preemption;
120
+ - message delay, loss, duplication, reordering, and stale delivery;
121
+ - crash placement and restart count;
122
+ - timeout races and late responses;
123
+ - retry, cancellation, callback, and reentrancy timing;
124
+ - external success, failure, ambiguity, and partial response;
125
+ - allocation reuse and identity generation.
126
+
127
+ Constrain a choice only when repository or platform evidence proves the behavior impossible. Put
128
+ each constraint in the assumption ledger so a deployment change cannot silently invalidate the
129
+ proof.
130
+
131
+ ## Atomicity claims
132
+
133
+ Treat every modeled atomic action as a theorem about observation boundaries.
134
+
135
+ Before merging implementation steps, check whether an intermediate state can be observed by:
136
+
137
+ - another thread or process;
138
+ - a callback, signal, cancellation, or destructor;
139
+ - crash recovery or journal replay;
140
+ - an external service or durable store;
141
+ - a monitoring, audit, or authorization decision.
142
+
143
+ Start with a fine-grained small model. Coarsen only after showing that intermediate states are
144
+ unobservable or refine to stuttering. A source line, function call, transaction wrapper, or lock
145
+ name is not automatic evidence of atomicity.
146
+
147
+ ## Deadlock livelock and starvation
148
+
149
+ Model every waitable resource, not only mutexes. Include row locks, channels, queues, futures,
150
+ callbacks, permits, leases, and bounded buffers in the wait relation.
151
+
152
+ Check separately:
153
+
154
+ - nonterminal states with no enabled transition;
155
+ - infinite cycles that change state without completing work;
156
+ - executions where the system progresses but one actor never does;
157
+ - timeout and cancellation paths that can themselves block;
158
+ - fairness assumptions used to exclude a non-progress trace.
159
+
160
+ Do not call a moving system live. Do not add global fairness merely to delete starvation. Attach
161
+ fairness only to the scheduler, queue, retry, or delivery mechanism that provides it.
162
+
163
+ ## Weak-memory boundary
164
+
165
+ Distinguish an algorithm proof under sequential consistency from an implementation proof under the
166
+ target language and hardware memory model.
167
+
168
+ Record:
169
+
170
+ - atomic and non-atomic accesses;
171
+ - read, write, and read-modify-write ordering;
172
+ - acquire, release, relaxed, sequentially consistent, or target-specific modes;
173
+ - data-race and undefined-behavior conditions;
174
+ - compiler and architecture targets;
175
+ - reclamation and allocation-reuse behavior.
176
+
177
+ If the design model omits weak-memory observations, label it as a design-level proof and add a
178
+ separate implementation-level check or argument. Do not promote success on one architecture to a
179
+ portable memory-order claim.
180
+
181
+ ## Network and epoch behavior
182
+
183
+ Avoid a single reliable FIFO channel unless the protocol contract truly provides it.
184
+
185
+ Model stale, delayed, duplicated, reordered, and lost messages together with current owner,
186
+ generation, term, epoch, or fencing state. Check that:
187
+
188
+ - stale generations cannot mutate current authority;
189
+ - duplicate requests cannot duplicate the protected effect;
190
+ - acknowledgments do not create authority before the durable decision;
191
+ - committed indices, epochs, or versions do not move backward;
192
+ - retry and status lookup return a stable result for one operation identity.
193
+
194
+ Bound message multiplicity for tractability, but preserve at least one representative duplicate and
195
+ reordering path whenever the protocol permits them.
196
+
197
+ ## Crash and recovery state
198
+
199
+ Split volatile and durable state. Permit a crash at every persistence and external-effect boundary
200
+ that the implementation can expose.
201
+
202
+ Check recovery for:
203
+
204
+ - pre-operation or fully committed post-operation state;
205
+ - idempotence across repeated recovery attempts;
206
+ - partial journal or metadata updates;
207
+ - external success before local record and local record before acknowledgment;
208
+ - stale recovery workers and fencing;
209
+ - durability, flush, atomic-write, and ordering assumptions.
210
+
211
+ Do not test only the recovery function with example files. The property covers the cross-product of
212
+ execution prefix, durable prefix, crash point, restart, and replay observation.
213
+
214
+ ## Duplicate effects and result replay
215
+
216
+ Replace an `exactly once` slogan with explicit invariants:
217
+
218
+ - one operation identity causes at most one protected external or economic effect;
219
+ - every successful retry returns the stored result of that operation;
220
+ - deduplication state and the protected effect cannot commit in contradictory orders;
221
+ - an ambiguous external outcome is reconciled before another effect attempt;
222
+ - compensation has its own identity, precondition, and idempotency rule.
223
+
224
+ Model effect execution and acknowledgment as different transitions. Preserve unknown outcome as a
225
+ real state; do not convert transport failure into business failure or permission to retry blindly.
226
+
227
+ ## Property-directed slicing
228
+
229
+ Build one model slice per property. Keep variables and transitions that can influence:
230
+
231
+ - the property expression;
232
+ - enabledness and fairness of relevant actions;
233
+ - observations used by refinement;
234
+ - the smallest plausible counterexample.
235
+
236
+ Remove UI, logging, payload, and unrelated service state only after showing they cannot alter those
237
+ dependencies. When a counterexample is spurious, expand the slice with the minimal missing relation.
238
+ Do not start with a full-system product model and call state explosion inevitable.
239
+
240
+ ## Identity symmetry and role abstraction
241
+
242
+ Merge states that differ only by renaming when initial states, transitions, and properties are
243
+ invariant under that renaming.
244
+
245
+ Normalize identity by first-seen order when only equality matters. Preserve role distinctions such
246
+ as current owner, stale owner, duplicate request, conflicting key, quorum member, or failed node.
247
+ Do not apply symmetry when numeric identity, ordering, hashing, locality, leader preference, or
248
+ partition placement affects behavior.
249
+
250
+ Record the symmetry group or normalization rule and one counterexample that would break it. Treat a
251
+ small instance as a bounded model unless a separate cutoff or induction argument generalizes it.
252
+
253
+ ## Partial-order and stateless exploration
254
+
255
+ Use partial-order reduction only for transitions proven independent under the property observation.
256
+ Transitions conflict when they touch the same state, channel, lock, external object, enabledness, or
257
+ observable event, even if their source code lives in different modules.
258
+
259
+ For implementation-level schedule exploration, use dependency and happens-before information to
260
+ enumerate schedule alternatives within explicit task, loop, and context bounds. Record whether the
261
+ method models weak memory or only sequentially consistent executions.
262
+
263
+ Compare a shallow unreduced model with the reduced model. A reduction that removes a known witness
264
+ or changes property truth is unsound for that configuration.
265
+
266
+ ## Reduction soundness
267
+
268
+ Classify every state-space optimization:
269
+
270
+ - representation compression that preserves states;
271
+ - symmetry or partial-order quotient justified by an equivalence;
272
+ - transition coarsening justified by stuttering or observation;
273
+ - hashing or lossy storage that may omit states;
274
+ - bounded omission of actors, values, failures, or schedules.
275
+
276
+ Keep proof-preserving reductions separate from bug-hunting shortcuts in configuration and reports.
277
+ Record whether liveness and fairness remain valid under the selected reduction; a reduction sound
278
+ for safety may not preserve an infinite-trace property.
279
+
280
+ ## Bound ladders and lossy search
281
+
282
+ Increase one structural risk axis at a time:
283
+
284
+ - actor or node count;
285
+ - context switches;
286
+ - crash and restart count;
287
+ - duplicate or reordered message count;
288
+ - retry count;
289
+ - value or identity roles;
290
+ - trace and loop depth.
291
+
292
+ Prefer short counterexamples and thresholds around known failures. Record the largest completed
293
+ domain, every incomplete run, and whether state storage was lossy. Multiple seeds in a lossy search
294
+ improve bug-finding coverage but never turn it into exhaustive evidence.
295
+
296
+ ## Abstraction refinement and inductive strengthening
297
+
298
+ Use a spurious counterexample to identify one missing predicate, state relation, or environment
299
+ guarantee. Add only the fact needed to distinguish the impossible behavior and rerun concretization.
300
+
301
+ For inductive proof failures, distinguish:
302
+
303
+ - a reachable safety violation;
304
+ - an unreachable predecessor allowed by a weak invariant;
305
+ - a modeling or translation error;
306
+ - a solver or resource limitation.
307
+
308
+ Strengthen with ownership, epoch monotonicity, log consistency, type range, or message-state lemmas.
309
+ Do not keep increasing induction depth without explaining what excludes the reported predecessor.
310
+
311
+ ## Compositional proof and cutoff claims
312
+
313
+ Verify components under explicit assume-guarantee contracts, then prove that connected components
314
+ discharge one another's assumptions. Include shared resources, scheduler behavior, overload,
315
+ recovery, and external effects that cross component boundaries.
316
+
317
+ Use a finite cutoff to claim arbitrary-size behavior only when a theorem applies to the protocol and
318
+ property class. Record the cutoff premise and proof. An experiment where three actors pass is not a
319
+ cutoff theorem and does not establish one hundred actors.
320
+
321
+ ## Model-based test bridge
322
+
323
+ Generate concrete tests from model states, transitions, histories, and counterexamples to validate
324
+ the model-to-implementation adapter.
325
+
326
+ Preserve:
327
+
328
+ - model and property revision;
329
+ - abstract state and chosen transition;
330
+ - concrete fixture and event schedule;
331
+ - fault injection point;
332
+ - expected abstract and concrete observations;
333
+ - refinement result and mismatch classification.
334
+
335
+ Use generated tests to catch mapping drift and exercise implementation boundaries. They sample or
336
+ enumerate a configured domain; they do not replace model completeness, induction, or deductive
337
+ proof.
338
+
339
+ ## SMT result question
340
+
341
+ Ask for the existence of a counterexample by combining assumptions, executable semantics, and the
342
+ negated property.
343
+
344
+ Preserve three primary outcomes:
345
+
346
+ - satisfiable: extract a candidate counterexample assignment or trace;
347
+ - unsatisfiable: the encoded assumptions imply the property in the supported logic;
348
+ - unknown or resource failure: no correctness conclusion.
349
+
350
+ Keep parser, unsupported feature, timeout, memory exhaustion, and integration failure distinct.
351
+ Do not map absence of a printed model to unsatisfiable or valid.
352
+
353
+ ## Theory and representation selection
354
+
355
+ Match each executable domain to the solver representation:
356
+
357
+ - mathematical integer only for truly unbounded arithmetic or an explicit refinement layer;
358
+ - fixed-width bit-vector for wrapping, masks, signedness, and machine overflow;
359
+ - floating-point theory for rounding, exceptional values, and signed zero;
360
+ - arrays for total maps plus explicit bounds and allocation facts;
361
+ - strings and regular languages for their supported semantic fragment;
362
+ - algebraic datatypes for mutually exclusive state variants.
363
+
364
+ Make every conversion between theories explicit. A convenient theory choice changes the program
365
+ being proved if it erases overflow, out-of-bounds access, rounding, or invalid representations.
366
+
367
+ ## SSA paths loops and memory
368
+
369
+ Translate mutation into versioned state or an equivalent transition relation. Attach branch guards
370
+ to each path and join values explicitly. Summarize calls only with proved preconditions,
371
+ postconditions, frames, and failure outcomes.
372
+
373
+ For loops, distinguish finite unfolding from induction. Require an unwinding or completeness
374
+ assertion before claiming the public domain fits the bound. Treat a failed induction step as a
375
+ prompt for stronger invariants, not automatically as a reachable program trace.
376
+
377
+ For memory, model allocation identity, offset, size, initialization, lifetime, alignment,
378
+ provenance, and alias permission. A total solver array does not reject an out-of-range index unless
379
+ the encoding does.
380
+
381
+ ## Datatypes and uninterpreted functions
382
+
383
+ Use algebraic datatypes to eliminate impossible Boolean combinations and retain payloads attached to
384
+ valid states. Keep success, typed failure, unknown, and absent values distinct.
385
+
386
+ Use an uninterpreted function only when its omitted implementation is irrelevant to the property.
387
+ Assume no property beyond functional congruence unless separately justified. Record every added
388
+ axiom such as injectivity, collision resistance, order preservation, or range restriction in the
389
+ assumption manifest. Prefer a wider nondeterministic result to an unrealistically perfect external
390
+ function for safety checks.
391
+
392
+ ## Quantifiers triggers and incremental contexts
393
+
394
+ Prefer finite expansion, structural induction, or specialized decision procedures before general
395
+ quantification. When quantifiers remain, record patterns, ground terms, instantiation counts,
396
+ matching loops, and solver-version sensitivity.
397
+
398
+ Reuse common constraints with scoped incremental contexts only through an adapter that guarantees
399
+ push and pop balance. Name assumptions so feature and path combinations can be checked without
400
+ leaking constraints between obligations. Preserve per-obligation timeout, result, model, and core
401
+ metadata.
402
+
403
+ ## Unsat evidence and replay
404
+
405
+ Treat an unsat core as a set of constraints sufficient for inconsistency, not as a proof explanation
406
+ or a necessarily minimal root cause. Check satisfiability of environment assumptions independently
407
+ and remove expected assumptions to confirm sensitivity.
408
+
409
+ For satisfiable outcomes, replay the model under the original program or transition semantics. For
410
+ high-risk unsatisfiable outcomes, preserve the exact input formula, options, solver identity, and
411
+ proof artifact when available; validate with an independent checker or another encoding or solver
412
+ when justified. Do not call a log line or core a proof certificate.
413
+
414
+ ## Failure matrix
415
+
416
+ | Failure or proof smell | Required response |
417
+ | --- | --- |
418
+ | Final state is safe after a forbidden duplicate effect. | Add an action or trace property over the effect history. |
419
+ | Desired safety property is not inductive. | Strengthen the invariant and check initialization, preservation, and implication separately. |
420
+ | Concrete retry has no abstract step. | Add a stuttering or explicit retry mapping and validate the observation. |
421
+ | An under-approximation passes. | Report bounded bug-finding evidence or add a completeness argument. |
422
+ | Atomic action hides a crash or callback boundary. | Split the transition or prove the intermediate state unobservable. |
423
+ | Fairness removes a starving execution. | Tie fairness to a real scheduling guarantee or weaken the claim. |
424
+ | Reduced search misses a known witness. | Disable or repair the reduction before interpreting results. |
425
+ | Small actor count passes without a cutoff theorem. | Report the finite scope and stop the arbitrary-size claim. |
426
+ | Mathematical integers hide machine overflow. | Select fixed-width semantics or prove a range refinement. |
427
+ | Solver array accepts an invalid index. | Add allocation and bounds obligations to the memory model. |
428
+ | Quantifier result changes with a trigger. | Treat the proof as brittle and inspect instantiation evidence. |
429
+ | Unsat core is presented as a certificate. | Preserve the formula and use proof-checking or independent evidence. |
430
+
431
+ ## Invariants
432
+
433
+ - State, action, trace, relational, and liveness properties remain distinct.
434
+ - Every safety proof identifies an inductive invariant or reports only bounded exploration.
435
+ - Every abstraction names its direction and the observations it preserves.
436
+ - Every atomicity and state-space reduction has a soundness argument for the selected property.
437
+ - Lossy search and bounded omission remain bug-finding evidence unless completeness is proved.
438
+ - Concurrent histories preserve invocation, response, real-time order, and visible effects.
439
+ - Weak-memory implementation claims use the target language and architecture semantics.
440
+ - Network and crash models include the permitted stale, duplicate, ambiguous, and recovery paths.
441
+ - SMT theories match executable numeric, memory, string, and state semantics.
442
+ - Satisfiable, unsatisfiable, unknown, timeout, unsupported, and tool failure remain distinct.
443
+ - Model-based tests validate refinement but do not replace formal completeness.
444
+
445
+ ## Skill handoffs
446
+
447
+ - Use `formal-verification-review` for property layers, abstractions, reductions, model checking,
448
+ solver encodings, result evidence, refinement, and model-based test derivation.
449
+ - Use `race-condition-review` for concrete interleavings, synchronization, atomics, memory ordering,
450
+ schedule reproduction, and implementation fixes.
451
+ - Use `two-phase-transition-integrity-review` for the real admission, durable decision, fencing,
452
+ recovery, compensation, and authority protocol being modeled.
453
+ - Use `idempotency-integrity-review` for concrete operation identity, duplicate suppression, stale
454
+ write rejection, and result-replay implementation.
455
+ - Use `fuzz-harness-review` for coverage-guided or randomized harnesses, corpus operation, mutation,
456
+ campaign reliability, and crash triage.
457
+ - Use `test-maintenance` for deterministic implementation regressions derived from model traces.