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,434 @@
1
+ # Formal Contracts and Modeling Checklist
2
+
3
+ Use this checklist when reviewing Hoare-style contracts, weakest preconditions, loop or object
4
+ invariants, termination, ghost state, frame conditions, state-machine models, liveness, fairness,
5
+ tool selection, bounded scope, or proof trust boundaries.
6
+
7
+ ## Contents
8
+
9
+ 1. [Claim envelope](#claim-envelope)
10
+ 2. [Precondition ownership](#precondition-ownership)
11
+ 3. [Weakest-precondition reasoning](#weakest-precondition-reasoning)
12
+ 4. [Loop and recursion obligations](#loop-and-recursion-obligations)
13
+ 5. [Processed-region invariants](#processed-region-invariants)
14
+ 6. [Partial and total correctness](#partial-and-total-correctness)
15
+ 7. [Ghost and old state](#ghost-and-old-state)
16
+ 8. [Frame conditions](#frame-conditions)
17
+ 9. [Aliasing and memory regions](#aliasing-and-memory-regions)
18
+ 10. [Object invariants and reentrancy](#object-invariants-and-reentrancy)
19
+ 11. [Abnormal outcomes](#abnormal-outcomes)
20
+ 12. [Machine and mathematical values](#machine-and-mathematical-values)
21
+ 13. [Vacuity and reachability](#vacuity-and-reachability)
22
+ 14. [Verification-family selection](#verification-family-selection)
23
+ 15. [State-machine abstraction](#state-machine-abstraction)
24
+ 16. [Safety, progress, and liveness](#safety-progress-and-liveness)
25
+ 17. [Fairness assumptions](#fairness-assumptions)
26
+ 18. [Scope and bounded search](#scope-and-bounded-search)
27
+ 19. [Result taxonomy](#result-taxonomy)
28
+ 20. [Trusted computing base](#trusted-computing-base)
29
+ 21. [Tool-family failure modes](#tool-family-failure-modes)
30
+ 22. [Failure matrix](#failure-matrix)
31
+ 23. [Invariants](#invariants)
32
+ 24. [Skill handoffs](#skill-handoffs)
33
+
34
+ ## Claim envelope
35
+
36
+ Write every formal result as a scoped envelope:
37
+
38
+ - model and specification revision;
39
+ - quantified input and initial-state domain;
40
+ - transition or command semantics;
41
+ - observed state, event, output, or trace;
42
+ - safety, progress, liveness, termination, refinement, equivalence, or reachability property;
43
+ - preconditions and environment guarantees;
44
+ - fairness, failure, timing, and resource assumptions;
45
+ - integer, memory, and target semantics;
46
+ - finite scope, trace, unwind, recursion, or other bounds;
47
+ - abstraction and omitted behavior;
48
+ - tool result and completeness category;
49
+ - trusted computing base;
50
+ - implementation mapping and replay evidence.
51
+
52
+ Avoid statements such as `the system is verified` or `the function is correct`. Prefer a claim that
53
+ names the exact property and its domain.
54
+
55
+ ## Precondition ownership
56
+
57
+ A precondition transfers a proof obligation to the caller. Use it only for inputs genuinely outside
58
+ the operation's definition or for guarantees established by a stronger verified boundary.
59
+
60
+ For each precondition, record:
61
+
62
+ - which caller proves it;
63
+ - where that proof is checked or derived;
64
+ - whether untrusted external input can violate it;
65
+ - what runtime behavior occurs when it is not established;
66
+ - whether it narrows an existing public contract;
67
+ - one concrete satisfying witness;
68
+ - one boundary case that must remain in the function's failure domain.
69
+
70
+ Do not make ordinary invalid, hostile, or environmental input disappear with an assumption merely
71
+ to simplify the implementation proof. Model a typed failure, error code, exception, rejection, or
72
+ other explicit outcome when the API accepts that input domain.
73
+
74
+ ## Weakest-precondition reasoning
75
+
76
+ Start from the desired postcondition and move backward through the command.
77
+
78
+ - For assignment, substitute the assigned expression into the postcondition.
79
+ - For a branch, derive obligations for both branch conditions and join them.
80
+ - For a call, use the callee's postcondition and prove its precondition.
81
+ - For mutation, include frames and old-state relations.
82
+ - For failure, cancellation, or exception, derive a separate outcome obligation.
83
+ - For a loop, find an invariant strong enough to imply the postcondition at exit.
84
+
85
+ Use the backward calculation to place assertions and lemmas. A convenient assertion that does not
86
+ contribute to a required postcondition can be useful documentation, but it is not proof progress.
87
+
88
+ ## Loop and recursion obligations
89
+
90
+ For every loop invariant prove:
91
+
92
+ 1. **initialization**: the invariant holds before the first iteration;
93
+ 2. **preservation**: one body execution from the invariant and guard re-establishes it;
94
+ 3. **exit usefulness**: the invariant plus the negated guard implies the postcondition.
95
+
96
+ For termination also prove:
97
+
98
+ 4. a variant belongs to a well-founded order;
99
+ 5. it decreases on every continuing iteration or recursive call;
100
+ 6. exceptional, retry, and continue paths cannot bypass the decrease.
101
+
102
+ An invariant that remains true forever but cannot derive the final guarantee is too weak. A variant
103
+ that decreases only on the happy path does not prove termination.
104
+
105
+ ## Processed-region invariants
106
+
107
+ Derive loop invariants by restricting the final property to completed work.
108
+
109
+ Examples:
110
+
111
+ - an aggregate equals the fold over the processed prefix;
112
+ - a searched prefix contains no matching value;
113
+ - a written region satisfies its output relation;
114
+ - an ordered prefix is sorted and related correctly to the remainder;
115
+ - processed graph nodes satisfy the visited invariant;
116
+ - committed log entries satisfy the durable prefix property;
117
+ - released resources are exactly the completed ownership set.
118
+
119
+ State the index, cursor, frontier, or processed set explicitly. Include the relationship between the
120
+ processed and unprocessed regions when the postcondition depends on both.
121
+
122
+ ## Partial and total correctness
123
+
124
+ Partial correctness says the postcondition holds if execution terminates. Total correctness also
125
+ proves termination for the quantified domain.
126
+
127
+ Keep separate:
128
+
129
+ - finite loop termination;
130
+ - recursive well-founded descent;
131
+ - retry termination or explicit unbounded service semantics;
132
+ - scheduler progress;
133
+ - absence of deadlock and livelock;
134
+ - eventual external response;
135
+ - resource-bounded completion.
136
+
137
+ Do not report a maintained invariant as a termination proof. Do not turn an environmental liveness
138
+ assumption into an implementation guarantee.
139
+
140
+ ## Ghost and old state
141
+
142
+ Capture logical history before destructive mutation when the final property compares old and new
143
+ state. Use ghost values, immutable snapshots, multisets, histories, or abstract ownership maps.
144
+
145
+ Separate properties such as:
146
+
147
+ - output is ordered;
148
+ - output contains exactly the original elements;
149
+ - no item was duplicated or lost;
150
+ - balance or ledger conservation holds;
151
+ - every emitted event corresponds to one prior state transition;
152
+ - ownership moved exactly once;
153
+ - data outside the changed region is preserved.
154
+
155
+ Ghost state must not change executable behavior. If proof code is extracted or compiled, confirm the
156
+ tool's erasure and trust boundary rather than assuming it.
157
+
158
+ ## Frame conditions
159
+
160
+ Specify reads, writes, and unchanged state.
161
+
162
+ For every outcome, name:
163
+
164
+ - objects, fields, regions, files, records, capabilities, or ghost state that may be read;
165
+ - locations that may be mutated;
166
+ - locations that must remain equal to their old value;
167
+ - ownership transferred or retained;
168
+ - externally visible events permitted;
169
+ - resources acquired, released, or left open;
170
+ - cache or index state intentionally affected.
171
+
172
+ A correct returned value does not prove absence of unrelated damage. Failure frames are often
173
+ stronger than success frames because callers rely on no partial mutation.
174
+
175
+ ## Aliasing and memory regions
176
+
177
+ Pointer or reference inequality does not prove non-overlap. Model a memory region with allocation
178
+ identity plus a half-open offset range when possible.
179
+
180
+ Prove:
181
+
182
+ - offset and length arithmetic before range construction;
183
+ - `0 <= start <= end <= allocationSize`;
184
+ - empty and adjacent ranges;
185
+ - non-overlap or the intended overlap semantics;
186
+ - alias permissions and exclusivity;
187
+ - reads and writes through every alias;
188
+ - ownership and lifetime across calls;
189
+ - provenance and target-specific pointer rules where relevant.
190
+
191
+ Use one interval convention consistently. Half-open ranges make empty regions and length arithmetic
192
+ explicit, but they do not eliminate overflow in endpoint calculation.
193
+
194
+ ## Object invariants and reentrancy
195
+
196
+ An object invariant is shared by its constructor and every public transition. Record:
197
+
198
+ - construction point where the invariant first becomes true;
199
+ - methods that assume it;
200
+ - fields and related objects covered;
201
+ - temporary internal states that may break it;
202
+ - callbacks, virtual calls, observers, destructors, finalizers, and async yields that can reenter;
203
+ - atomic boundary or lock protecting broken intermediate state;
204
+ - failure cleanup that restores or retires the object.
205
+
206
+ Do not publish a half-updated object and rely on callers to invoke setters in the right order. Make
207
+ valid state transitions explicit and atomic at the public observation boundary.
208
+
209
+ ## Abnormal outcomes
210
+
211
+ Write separate postconditions for:
212
+
213
+ - normal success;
214
+ - typed or enumerated failure;
215
+ - exception or panic where part of the contract;
216
+ - cancellation;
217
+ - timeout or deadline;
218
+ - partial read or write;
219
+ - retryable unknown result;
220
+ - rollback success or failure;
221
+ - resource exhaustion;
222
+ - process or external-component failure.
223
+
224
+ State which mutations, events, ownership transfers, reservations, and resources survive each path.
225
+ Do not prove the happy return while leaving half of the implementation outside the contract.
226
+
227
+ ## Machine and mathematical values
228
+
229
+ Separate mathematical values from the target program's representations.
230
+
231
+ Record:
232
+
233
+ - width and signedness;
234
+ - overflow as wrap, trap, checked failure, saturation, undefined behavior, or another rule;
235
+ - cast truncation, extension, and reinterpretation;
236
+ - shift domain;
237
+ - division and remainder boundaries;
238
+ - floating-point rounding, exceptional values, signed zero, and contraction;
239
+ - pointer or reference representation;
240
+ - debug, release, target, or feature differences.
241
+
242
+ If a proof uses unbounded integers for convenience, add range lemmas connecting every executable
243
+ operation to the machine domain. Otherwise the proved program and executed program are different.
244
+
245
+ ## Vacuity and reachability
246
+
247
+ Detect false-green proofs caused by inconsistent assumptions or unreachable states.
248
+
249
+ Require:
250
+
251
+ - a satisfying witness for important precondition sets;
252
+ - at least one valid initial state;
253
+ - reachability or cover properties for critical success and failure branches;
254
+ - nonempty transition domains;
255
+ - an example that reaches each fairness-dependent action where relevant;
256
+ - a negative control that inverts a key postcondition or violates the invariant;
257
+ - mutation or implementation removal that makes the proof fail;
258
+ - scope large enough to include the smallest plausible failure.
259
+
260
+ A false precondition, contradictory invariant, empty model, or unreachable action can prove almost
261
+ anything. Proof success without sensitivity evidence is weak.
262
+
263
+ ## Verification-family selection
264
+
265
+ Choose by the property and desired evidence:
266
+
267
+ | Need | Useful family | Main limitation to report |
268
+ | --- | --- | --- |
269
+ | Concurrent state transitions and short traces | Explicit or symbolic model checking | State abstraction, fairness, scope, and trace bound |
270
+ | Relational structures and small counterexamples | Finite relational analysis | Instance scope and integer encoding |
271
+ | Executable imperative contracts | SMT-backed program verification | Automation stability, axioms, externals, and generated-code boundary |
272
+ | Memory or arithmetic bugs within explicit bounds | Bounded model checking or symbolic execution | Unwind, object, path, and environment bounds |
273
+ | Reusable mathematical or semantic theorem | Kernel-checked proof assistant | Formalization gap, axioms, extraction, libraries, and runtime boundary |
274
+ | Compiler transformation instance | Translation validation | Supported IR, memory, target, and solver model |
275
+
276
+ Layer families when their blind spots differ. Do not standardize one tool across every property merely
277
+ to simplify procurement or training.
278
+
279
+ ## State-machine abstraction
280
+
281
+ Model behavior that affects the property:
282
+
283
+ - durable and volatile state;
284
+ - actions and enabled conditions;
285
+ - nondeterministic choices;
286
+ - failure, retry, duplication, delay, loss, cancellation, and recovery;
287
+ - ownership, epochs, versions, or fencing;
288
+ - observable outputs and invariants;
289
+ - environment actions and interference;
290
+ - atomicity boundaries.
291
+
292
+ Omit serialization, logging, field layout, and implementation steps only when they cannot change the
293
+ property. Refining several implementation steps into one atomic model action is a proof obligation,
294
+ not a modeling convenience.
295
+
296
+ ## Safety, progress, and liveness
297
+
298
+ Keep property classes distinct:
299
+
300
+ - **safety**: no forbidden state or event occurs;
301
+ - **progress**: a measure advances or a pending operation can take a next step;
302
+ - **termination**: the computation finishes for the quantified domain;
303
+ - **liveness**: a desired event eventually occurs;
304
+ - **deadlock freedom**: the system does not reach a nonterminal state with no action;
305
+ - **starvation freedom**: an enabled actor is not postponed forever;
306
+ - **bounded response**: completion occurs within a modeled resource or step bound.
307
+
308
+ An invariant proves safety, not liveness. A found short trace disproves a property, while failure to
309
+ find one may be only bounded evidence.
310
+
311
+ ## Fairness assumptions
312
+
313
+ Fairness constrains which infinite behaviors the model considers.
314
+
315
+ For each fairness assumption, name:
316
+
317
+ - action or actor covered;
318
+ - weak, strong, or another exact condition;
319
+ - implementation or platform mechanism that supports it;
320
+ - failure and overload modes where it stops holding;
321
+ - liveness properties that depend on it;
322
+ - whether timeout, retry, or scheduling is abstracted by the same assumption.
323
+
324
+ Do not grant eventual execution to every continuously or repeatedly enabled action unless the real
325
+ scheduler, queue, lease, or retry policy provides that guarantee. Overpowered fairness can delete the
326
+ very starvation behavior the model was meant to find.
327
+
328
+ ## Scope and bounded search
329
+
330
+ Record all finite limits:
331
+
332
+ - actors, nodes, resources, messages, records, or objects;
333
+ - integer and bit-vector width;
334
+ - sequence, set, and relation size;
335
+ - trace or time steps;
336
+ - loop unwind and recursion;
337
+ - scheduler choices;
338
+ - allocation and memory;
339
+ - solver time and state count.
340
+
341
+ Build a scope ladder around known minimal counterexamples and structural thresholds. A bounded search
342
+ that finds no counterexample proves only the explored domain unless the tool supplies a completeness
343
+ argument. Unbounded time with finite object scope is still a finite-domain model.
344
+
345
+ ## Result taxonomy
346
+
347
+ Preserve at least:
348
+
349
+ - `valid`: the property is established under the declared model and completeness contract;
350
+ - `invalid`: a checked proof obligation fails;
351
+ - `counterexample`: a concrete model trace or assignment violates the property;
352
+ - `unknown`: the solver cannot decide;
353
+ - `timeout`: the resource limit was reached;
354
+ - `unsupported`: the model or feature is outside the tool's semantics;
355
+ - `incomplete-bound`: exploration stopped without covering all permitted executions;
356
+ - `tool-failure`: parser, runtime, integration, or internal failure;
357
+ - `unstable`: repeated equivalent verification changes result or resource class.
358
+
359
+ Do not collapse every non-counterexample state into success. Preserve raw tool status and the adapter
360
+ mapping used by CI.
361
+
362
+ ## Trusted computing base
363
+
364
+ Map which components must be correct for the final claim:
365
+
366
+ - logic and proof kernel;
367
+ - solver and proof-certificate checker;
368
+ - axioms, admitted facts, unsafe tactics, and reflection;
369
+ - standard and third-party proof libraries;
370
+ - model translator, front end, or verifier encoding;
371
+ - external stubs and environmental models;
372
+ - extraction and code generation;
373
+ - ordinary compiler and linker;
374
+ - runtime, garbage collector, FFI, operating system, and hardware;
375
+ - model-to-implementation and trace-replay adapters.
376
+
377
+ A small proof kernel narrows one part of trust. It does not automatically verify extracted code,
378
+ native libraries, deployment configuration, or hardware.
379
+
380
+ ## Tool-family failure modes
381
+
382
+ Review family-specific gaps without hard-coding vendor behavior:
383
+
384
+ - explicit-state checking: state explosion, symmetry mistakes, missing failures, overpowered fairness;
385
+ - relational analysis: scope too small, integer encoding surprises, bounded temporal horizon;
386
+ - SMT-backed program proof: quantifier triggers, large contexts, solver version sensitivity,
387
+ accidental axioms, unstable resource use;
388
+ - bounded checking: insufficient unwind, path explosion, environment stubs, unsupported operations;
389
+ - proof assistants: admitted theorems, inconsistent axioms, extraction gap, library trust, proof debt;
390
+ - translation validation: unsupported instructions, incomplete memory model, timeout, target mismatch.
391
+
392
+ Record the exact result and supported fragment. Do not generalize one proved instance into a proof of
393
+ an implementation family.
394
+
395
+ ## Failure matrix
396
+
397
+ | Failure or proof smell | Required response |
398
+ | --- | --- |
399
+ | Strong postcondition with impossible precondition. | Produce a witness or classify the proof as vacuous. |
400
+ | Invariant holds but loop may run forever. | Report partial correctness and add a well-founded variant. |
401
+ | Correct result but unrelated memory changes. | Add frame and old-state obligations. |
402
+ | Two pointers differ but ranges overlap. | Model allocation identity and half-open ranges. |
403
+ | Object invariant is broken during a callback. | Restore before reentry or refine the atomic boundary. |
404
+ | Mathematical integer proof is applied to fixed-width code. | Add machine semantics and range obligations. |
405
+ | No bounded counterexample is found. | Report exact scope and completeness, not universal validity. |
406
+ | Liveness requires arbitrary strong fairness. | Justify the scheduler guarantee or weaken the claim. |
407
+ | Solver returns unknown or timeout. | Preserve the status and stop false-green mapping. |
408
+ | Extracted code calls unverified native functions. | Add runtime validation and include them in the trust ledger. |
409
+
410
+ ## Invariants
411
+
412
+ - Every formal claim names its model, domain, observation, assumptions, bounds, and trust base.
413
+ - Every precondition has an owning caller and a satisfiable witness.
414
+ - Every loop proof covers initialization, preservation, exit usefulness, and stated termination.
415
+ - Every mutating contract includes frames and old-state relations.
416
+ - Every public outcome has an explicit post-state contract.
417
+ - Machine-level claims use machine-level numeric and memory semantics.
418
+ - Safety, progress, termination, liveness, and fairness remain separate properties.
419
+ - Bounded absence of a counterexample is never reported beyond the explored domain.
420
+ - Every tool result preserves unknown, timeout, unsupported, and incomplete states.
421
+ - Proof-kernel trust is not confused with generated binary or deployment trust.
422
+
423
+ ## Skill handoffs
424
+
425
+ - Use `formal-verification-review` for model scope, proof obligations, boundedness, assumptions,
426
+ result taxonomy, trust, refinement, and proof operation.
427
+ - Use `race-condition-review` for concrete interleavings, synchronization, memory ordering, schedule
428
+ reproduction, and implementation fixes.
429
+ - Use `compiler-engineering-review` for compiler IR refinement, translation validation, miscompile
430
+ localization, and code-generation evidence.
431
+ - Use `memory-lifetime-review` for concrete ownership, cleanup, retained references, and native
432
+ resource defects.
433
+ - Use `test-maintenance` for deterministic regressions promoted from formal counterexamples.
434
+ - Use the matching language skill for executable integer, pointer, unsafe, FFI, and memory semantics.