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,509 @@
1
+ # Formal Memory, Bounds, and CI Checklist
2
+
3
+ Use this checklist when proving machine arithmetic, indexing, pointers, allocation lifetime,
4
+ bounded exploration, external stubs, counterexample replay, assumption governance, refinement maps,
5
+ verification cost, proof brittleness, or continuous verification behavior.
6
+
7
+ ## Contents
8
+
9
+ 1. [Target arithmetic semantics](#target-arithmetic-semantics)
10
+ 2. [Pre-operation overflow obligations](#pre-operation-overflow-obligations)
11
+ 3. [Casts and shifts](#casts-and-shifts)
12
+ 4. [Index construction](#index-construction)
13
+ 5. [Pointer validity](#pointer-validity)
14
+ 6. [Range overlap](#range-overlap)
15
+ 7. [Allocation lifetime state machine](#allocation-lifetime-state-machine)
16
+ 8. [Boundary partitions](#boundary-partitions)
17
+ 9. [Bounded-check completeness](#bounded-check-completeness)
18
+ 10. [Nondeterministic unsafe and FFI harnesses](#nondeterministic-unsafe-and-ffi-harnesses)
19
+ 11. [Counterexample replay](#counterexample-replay)
20
+ 12. [Verification lanes](#verification-lanes)
21
+ 13. [Toolchain and solver pinning](#toolchain-and-solver-pinning)
22
+ 14. [Specification ownership](#specification-ownership)
23
+ 15. [CI result mapping](#ci-result-mapping)
24
+ 16. [Proof cost telemetry](#proof-cost-telemetry)
25
+ 17. [Vacuity and sensitivity jobs](#vacuity-and-sensitivity-jobs)
26
+ 18. [Assumption manifest](#assumption-manifest)
27
+ 19. [Contract compatibility](#contract-compatibility)
28
+ 20. [Verification-debt ratchet](#verification-debt-ratchet)
29
+ 21. [Counterexample assets](#counterexample-assets)
30
+ 22. [Executable refinement map](#executable-refinement-map)
31
+ 23. [Proof brittleness](#proof-brittleness)
32
+ 24. [Failure matrix](#failure-matrix)
33
+ 25. [Invariants](#invariants)
34
+ 26. [Skill handoffs](#skill-handoffs)
35
+
36
+ ## Target arithmetic semantics
37
+
38
+ Pin the executable value model before proving arithmetic:
39
+
40
+ - integer width and signedness;
41
+ - overflow behavior for each operation and build mode;
42
+ - checked, wrapping, saturating, trapping, or undefined operations;
43
+ - cast truncation, sign extension, zero extension, and reinterpretation;
44
+ - shift amount domain;
45
+ - division and remainder edge behavior;
46
+ - floating-point format, rounding, contraction, exceptions, NaN, infinity, and signed zero;
47
+ - pointer width and address-space rules;
48
+ - target, compiler, feature, and runtime assumptions.
49
+
50
+ If the specification uses mathematical integers or reals, create explicit refinement lemmas from
51
+ the mathematical domain to the target representation. A proof over a larger ideal domain does not
52
+ automatically hold for fixed-width execution.
53
+
54
+ ## Pre-operation overflow obligations
55
+
56
+ Prove safety before evaluating an operation that can overflow or become undefined.
57
+
58
+ For unsigned-style arithmetic, useful shapes include:
59
+
60
+ - addition: `a <= MAX - b`;
61
+ - subtraction: `b <= a` when underflow is forbidden;
62
+ - multiplication: `a == 0 || b <= MAX / a`;
63
+ - endpoint: `start <= limit && length <= limit - start`;
64
+ - midpoint: derive from a nonnegative difference instead of adding endpoints first.
65
+
66
+ Signed domains need lower and upper obligations, including minimum negation, absolute value of the
67
+ minimum, and minimum divided by negative one where relevant.
68
+
69
+ Do not compute the dangerous value and assert afterward. The proof and implementation must avoid the
70
+ invalid intermediate operation itself.
71
+
72
+ ## Casts and shifts
73
+
74
+ Treat each cast and shift as a separate proof obligation.
75
+
76
+ Check:
77
+
78
+ - narrowing removes only proven-zero or otherwise allowed high bits;
79
+ - signed-to-unsigned conversion excludes or specifies negatives;
80
+ - unsigned-to-signed conversion stays in the target range;
81
+ - extension preserves the intended value;
82
+ - floating and integer conversion handles range, precision, NaN, and exceptional cases;
83
+ - shift amount is nonnegative and below the bit width;
84
+ - left-shift value constraints match the language semantics;
85
+ - pointer and integer conversion preserves only the guarantees the target memory model allows;
86
+ - reconstructed pointers retain required provenance and alignment.
87
+
88
+ A bit-pattern equality does not prove a valid typed value or usable pointer.
89
+
90
+ ## Index construction
91
+
92
+ Prove every arithmetic step that constructs an index.
93
+
94
+ For a range, prefer conditions that avoid overflowing an endpoint:
95
+
96
+ - `start <= total`;
97
+ - `length <= total - start`;
98
+ - access offset is below `length`;
99
+ - final index derives from already-proved differences.
100
+
101
+ For multidimensional layout, separate row multiplication, column addition, stride, padding, and final
102
+ allocation bounds. Include zero dimensions, empty slices, last valid element, one-past-end pointers,
103
+ and maximum representable sizes.
104
+
105
+ Do not infer safe intermediate arithmetic from a small final result; overflow can wrap back into the
106
+ accepted range.
107
+
108
+ ## Pointer validity
109
+
110
+ Non-null is only one obligation. A dereference may also require:
111
+
112
+ - allocation exists and has not been freed;
113
+ - offset and access width stay inside the allocation;
114
+ - alignment satisfies the accessed type;
115
+ - bytes are initialized where required;
116
+ - the bit pattern is valid for the target type;
117
+ - provenance permits the access;
118
+ - alias, exclusivity, and mutation rules hold;
119
+ - thread and synchronization rules permit the access;
120
+ - object lifetime covers the full operation;
121
+ - pinning or movement rules preserve the location.
122
+
123
+ Model unsafe code as a place where these obligations become explicit, not a region where undefined
124
+ behavior is permitted.
125
+
126
+ ## Range overlap
127
+
128
+ Represent a region as allocation identity plus `[start, end)` offsets. Before comparing regions,
129
+ prove endpoint arithmetic and allocation membership.
130
+
131
+ For two ranges, classify:
132
+
133
+ - distinct allocations;
134
+ - empty ranges;
135
+ - adjacent ranges;
136
+ - exact alias;
137
+ - partial overlap;
138
+ - containment;
139
+ - one-past-end values that are not dereferenceable;
140
+ - operation semantics that permit or forbid overlap.
141
+
142
+ Pointer inequality is insufficient. If overlap is allowed, prove the copy or move semantics under
143
+ the chosen direction and observation. If forbidden, make non-overlap a caller obligation with an
144
+ actual witness and runtime guard where untrusted callers exist.
145
+
146
+ ## Allocation lifetime state machine
147
+
148
+ Model allocation and resource lifetime as states and transitions, for example:
149
+
150
+ - absent;
151
+ - allocated but uninitialized;
152
+ - initialized and owned;
153
+ - borrowed or shared under a declared permission;
154
+ - moved or transferred;
155
+ - closing or partially released;
156
+ - freed or retired.
157
+
158
+ For each transition, prove:
159
+
160
+ - allowed source state;
161
+ - new owner and aliases;
162
+ - initialized fields and valid representations;
163
+ - access permissions;
164
+ - exactly-once release;
165
+ - failure cleanup;
166
+ - invalidation of stale aliases;
167
+ - callback, concurrency, and reentrancy behavior;
168
+ - external resource correspondence.
169
+
170
+ Integer timestamps or generation counters can support the model, but lifetime itself is a state and
171
+ ownership relation, not a numeric comparison.
172
+
173
+ ## Boundary partitions
174
+
175
+ Treat zero, one, minimum, maximum, and threshold-adjacent values as separate control-flow classes.
176
+
177
+ Cover:
178
+
179
+ - empty and singleton collections;
180
+ - `length - 1`, modulo by length, and last-element loops;
181
+ - minimum and maximum fixed-width values;
182
+ - exact capacity and capacity plus one;
183
+ - midpoint and binary-search arithmetic;
184
+ - zero-size allocation and one-past-end values;
185
+ - exact alignment and one unit of misalignment;
186
+ - recursion or loop bound minus one, equal, and plus one;
187
+ - scope or actor count around the smallest plausible counterexample.
188
+
189
+ Do not remove boundaries with assumptions merely because they complicate the proof. If the API truly
190
+ forbids them, prove the caller boundary and contract compatibility.
191
+
192
+ ## Bounded-check completeness
193
+
194
+ Record every bound used by symbolic or bounded exploration:
195
+
196
+ - loop unwind;
197
+ - recursion depth;
198
+ - allocation count and size;
199
+ - object, pointer, and thread count;
200
+ - array and input length;
201
+ - scheduler steps;
202
+ - trace length;
203
+ - integer bit width;
204
+ - external-call and retry count;
205
+ - solver time, memory, and path limits.
206
+
207
+ Require the tool's completeness, unwinding, or coverage assertion for all executions permitted by
208
+ the public input contract before making an unbounded claim. Otherwise state that the property holds
209
+ or no counterexample was found within the explicit domain.
210
+
211
+ Increasing a bound can change feasibility dramatically. Use a measured bound ladder and preserve the
212
+ largest completed domain plus all incomplete statuses.
213
+
214
+ ## Nondeterministic unsafe and FFI harnesses
215
+
216
+ For an unsafe wrapper or FFI adapter, generate every input allowed by the public precondition rather
217
+ than a few examples.
218
+
219
+ The harness should model or assume only:
220
+
221
+ - documented caller obligations;
222
+ - allocation and lifetime state;
223
+ - pointer range, alignment, initialization, and alias rules;
224
+ - machine arithmetic and target facts;
225
+ - permitted external return, failure, cancellation, and callback behavior;
226
+ - bounded resource and concurrency behavior.
227
+
228
+ Assert internal safety, returned state, frames, ownership, and cleanup. Keep external library stubs
229
+ in the assumption manifest and validate their concrete boundary at runtime. A stub is a modeled
230
+ promise, not a verified external implementation.
231
+
232
+ ## Counterexample replay
233
+
234
+ Convert a formal counterexample into a reproducible implementation experiment.
235
+
236
+ Preserve:
237
+
238
+ - model and property revision;
239
+ - exact bound and solver configuration;
240
+ - initial state and nondeterministic choices;
241
+ - transition trace;
242
+ - translated implementation input and event schedule;
243
+ - expected forbidden observation;
244
+ - implementation, compiler, runtime, and target identity;
245
+ - replay result and mismatch classification.
246
+
247
+ Replay can fail because the model is too abstract, the mapping drifted, the implementation differs,
248
+ the environment is missing, or the tool semantics do not match the target. Investigate the boundary
249
+ before dismissing the trace or declaring a product bug.
250
+
251
+ ## Verification lanes
252
+
253
+ Use bounded lanes with different purposes:
254
+
255
+ | Lane | Typical evidence |
256
+ | --- | --- |
257
+ | Change gate | Changed contracts, fast proofs, small bounded checks, assumption and debt delta |
258
+ | Main or merge | Broader module closure, counterexample replay, contract compatibility |
259
+ | Periodic | Larger scope, unwind, state exploration, repeated complexity and stability checks |
260
+ | Canary | Toolchain candidate, extraction or generated-code path, selected implementation traces |
261
+ | Release | Supported models, larger bounds, trusted-base review, binary or target evidence |
262
+
263
+ Each lane needs a declared time, memory, state, artifact, retry, and ownership budget. Do not move an
264
+ unbounded model exploration into a change gate. Do not report a skipped deeper lane as green.
265
+
266
+ ## Toolchain and solver pinning
267
+
268
+ Version every input that can change proof search or semantics:
269
+
270
+ - verifier or proof assistant;
271
+ - solver and proof-certificate checker;
272
+ - standard and third-party libraries;
273
+ - tactics, plugins, and code generators;
274
+ - compiler, linker, runtime, and target;
275
+ - command options, triggers, seeds, and resource settings;
276
+ - container or environment digest;
277
+ - package and toolchain lockfiles.
278
+
279
+ Upgrade verification infrastructure separately from feature changes. Compare valid, invalid,
280
+ unknown, timeout, unsupported, incomplete, resource count, counterexample, and generated artifact
281
+ changes before promotion.
282
+
283
+ ## Specification ownership
284
+
285
+ Treat specifications, models, assumptions, mappings, and proof code as production sources.
286
+
287
+ Require:
288
+
289
+ - named owners and reviewers;
290
+ - implementation and contract diffs shown together;
291
+ - stronger review for weakened postconditions, stronger preconditions, new axioms, or reduced bounds;
292
+ - source control and release history;
293
+ - direct links from implementation boundaries to owning formal artifacts;
294
+ - generated versus source-owned classification;
295
+ - migration plan when model schema or proof libraries change.
296
+
297
+ Changing a specification until the implementation verifies can be more dangerous than changing the
298
+ implementation. Make logical weakening visible.
299
+
300
+ ## CI result mapping
301
+
302
+ The CI adapter must preserve raw tool outcomes. Map at least:
303
+
304
+ - valid;
305
+ - invalid or failed obligation;
306
+ - concrete counterexample;
307
+ - unknown;
308
+ - timeout or resource exhausted;
309
+ - unsupported construct;
310
+ - incomplete unwind or scope;
311
+ - integration or tool failure;
312
+ - unstable result across repeats.
313
+
314
+ Treat every non-valid state according to repository policy, but never translate it to valid merely
315
+ because no counterexample was printed. Store raw logs and structured result metadata within privacy
316
+ and retention policy.
317
+
318
+ ## Proof cost telemetry
319
+
320
+ Track more than wall time:
321
+
322
+ - obligation and assertion count;
323
+ - solver resource count;
324
+ - explored and distinct states;
325
+ - scope, bit width, unwind, and trace bound;
326
+ - memory and generated artifact size;
327
+ - cache hit or proof reuse;
328
+ - retries and repeated-run variance;
329
+ - slowest lemma, method, property, or transition family.
330
+
331
+ Use resource and state counts to find growth before a hard timeout. Compare equivalent hardware or
332
+ normalized metrics where possible. A proof that remains valid but grows from seconds to minutes is
333
+ an operational regression.
334
+
335
+ ## Vacuity and sensitivity jobs
336
+
337
+ Run explicit proof-health checks:
338
+
339
+ - satisfiable precondition witness;
340
+ - reachable initial state;
341
+ - cover each critical success, failure, retry, cancellation, and cleanup branch;
342
+ - invert or negate a key postcondition;
343
+ - delete or bypass a required implementation step;
344
+ - inject a known invariant or frame violation;
345
+ - lower and raise bounds around a known counterexample;
346
+ - remove one assumption expected to be necessary;
347
+ - replay a retained negative control.
348
+
349
+ The goal is not a universal mutation score. It is proof that the current obligations are sensitive to
350
+ the defects they claim to exclude.
351
+
352
+ ## Assumption manifest
353
+
354
+ Maintain one machine-readable or reviewable inventory of:
355
+
356
+ - axioms and admitted or incomplete proofs;
357
+ - external, native, and FFI stubs;
358
+ - environment and scheduler models;
359
+ - fairness assumptions;
360
+ - integer and memory domains;
361
+ - object scopes, trace bounds, and unwind limits;
362
+ - unsupported features;
363
+ - generated-code, extraction, compiler, runtime, and hardware trust;
364
+ - privacy, security, and availability assumptions;
365
+ - owner, rationale, review date, and planned discharge.
366
+
367
+ Fail static policy when code introduces an undeclared assumption. Treat new assumptions, weaker
368
+ models, smaller bounds, and broader trusted components as reviewable risk deltas.
369
+
370
+ ## Contract compatibility
371
+
372
+ Compare old and new contracts logically.
373
+
374
+ For caller compatibility, the old accepted domain should remain inside the new accepted domain. A
375
+ typical obligation is that the old precondition implies the new precondition.
376
+
377
+ For guarantee compatibility, every new permitted result should still satisfy the old guarantee. A
378
+ typical obligation is that the new postcondition implies the old postcondition under a shared
379
+ observation and outcome.
380
+
381
+ Also compare:
382
+
383
+ - frames and allowed mutations;
384
+ - exceptional and failure postconditions;
385
+ - termination and liveness guarantees;
386
+ - fairness and environment assumptions;
387
+ - numeric and memory domains;
388
+ - bounds and trusted-base changes.
389
+
390
+ Textual diff does not reveal logical strengthening or weakening.
391
+
392
+ ## Verification-debt ratchet
393
+
394
+ Baseline debt categories:
395
+
396
+ - admitted, skipped, or placeholder proofs;
397
+ - unproved obligations;
398
+ - unknown, unsupported, or incomplete results;
399
+ - external assumptions and stubs;
400
+ - missing refinement mappings;
401
+ - low scope or unwind bounds;
402
+ - unstable or flaky proof obligations;
403
+ - absent counterexample replay;
404
+ - unowned specification or generated artifact.
405
+
406
+ Prevent changed scope from adding debt without explicit approval and rationale. Retire existing debt
407
+ incrementally, prioritizing security, concurrency, money, unsafe memory, external ownership, and
408
+ high-change boundaries. Do not demand instant total coverage if that would cause the verification
409
+ system to be bypassed or removed.
410
+
411
+ ## Counterexample assets
412
+
413
+ Keep counterexamples as durable evidence:
414
+
415
+ - original formal trace or assignment;
416
+ - minimized model trace when supported;
417
+ - implementation replay input and schedule;
418
+ - ordinary regression or property seed;
419
+ - model and implementation revisions;
420
+ - exact property identity and result taxonomy;
421
+ - bound, assumption, and environment capsule;
422
+ - resolution and root-cause notes;
423
+ - privacy and license classification.
424
+
425
+ Do not bury the only counterexample in transient CI logs. Do not discard the formal artifact after
426
+ promoting an ordinary test; the two assets prove different boundaries.
427
+
428
+ ## Executable refinement map
429
+
430
+ Connect model and implementation using an executable or mechanically checked map where feasible.
431
+
432
+ Map:
433
+
434
+ - model variables to implementation fields or derived facts;
435
+ - model actions to methods, events, storage transitions, or trace records;
436
+ - atomic model actions to one or more implementation steps;
437
+ - implementation-only states to abstraction classes;
438
+ - failures, retries, timeouts, and duplicates;
439
+ - identifiers, epochs, versions, and ownership;
440
+ - external observations and nondeterminism.
441
+
442
+ Use implementation logs to generate model action traces, model transitions to generate integration
443
+ inputs, or shared schemas to generate both sides. Validate map version and reject stale traces. A
444
+ prose table alone will drift.
445
+
446
+ ## Proof brittleness
447
+
448
+ Treat a proof as unstable when equivalent reruns or small unrelated edits cause large result or cost
449
+ changes.
450
+
451
+ Diagnose:
452
+
453
+ - oversized solver context;
454
+ - quantifier trigger sensitivity;
455
+ - hidden tactic or search ordering;
456
+ - shared global facts;
457
+ - monolithic methods or theorems;
458
+ - solver or library version drift;
459
+ - unstable generated names or order;
460
+ - proof cache contamination;
461
+ - resource limit cliffs.
462
+
463
+ Split lemmas and obligations, minimize imported facts, stabilize intermediate interfaces, and track
464
+ resource variance. Do not hide brittleness with retry-until-one-run-passes.
465
+
466
+ ## Failure matrix
467
+
468
+ | Failure or CI smell | Required response |
469
+ | --- | --- |
470
+ | Mathematical addition is proved but machine addition wraps. | Add target-width and pre-operation obligations. |
471
+ | `base + length` is checked only afterward. | Rewrite the guard to avoid invalid intermediate arithmetic. |
472
+ | Non-null pointer is outside its allocation. | Add allocation, offset, lifetime, alignment, and validity facts. |
473
+ | Bound is too small to cover an allowed loop. | Increase it or narrow the public domain; preserve incomplete status. |
474
+ | FFI stub promises successful output only. | Model declared failure and record the stub as an assumption. |
475
+ | Formal trace does not replay. | Inspect refinement, abstraction, environment, and version mapping. |
476
+ | Solver timeout is mapped to green. | Fix the CI adapter and preserve the raw result taxonomy. |
477
+ | Proof time triples while still valid. | Treat proof cost as an operational regression. |
478
+ | New axiom appears outside the manifest. | Reject or register it with owner and risk review. |
479
+ | Stronger precondition passes all implementation proofs. | Evaluate caller compatibility before accepting it. |
480
+ | Retry makes a flaky proof green. | Measure variance and repair brittleness instead of retrying. |
481
+
482
+ ## Invariants
483
+
484
+ - Arithmetic safety is established before the potentially invalid operation.
485
+ - Every index proof covers the arithmetic that creates the index.
486
+ - Pointer validity includes allocation, bounds, alignment, initialization, representation, alias,
487
+ provenance, and lifetime where the target requires them.
488
+ - Every bounded result reports its complete bound ledger and completeness status.
489
+ - External stubs remain assumptions and are validated at concrete runtime boundaries.
490
+ - Counterexamples retain both formal and implementation replay artifacts.
491
+ - CI preserves the verifier's complete result taxonomy.
492
+ - Toolchain, solver, libraries, options, and environment are versioned.
493
+ - Assumption and verification-debt growth is visible and owned.
494
+ - Contract compatibility is logical, not textual.
495
+ - Refinement maps are executable, versioned, and tested for drift.
496
+ - Flaky proof search is repaired, not hidden with retry.
497
+
498
+ ## Skill handoffs
499
+
500
+ - Use `formal-verification-review` for arithmetic and memory proof obligations, boundedness,
501
+ assumptions, counterexample replay, refinement, proof CI, and verification debt.
502
+ - Use `rust-code-change`, C or C++ skills, or another matching language skill for the executable
503
+ unsafe, integer, pointer, FFI, and target semantics.
504
+ - Use `memory-lifetime-review` for concrete cleanup, ownership, retained references, and resource
505
+ lifecycle outside the proof model.
506
+ - Use `race-condition-review` for actual schedules, synchronization, atomics, memory ordering, and
507
+ concurrency regression evidence.
508
+ - Use `test-maintenance` for ordinary tests promoted from counterexamples.
509
+ - Use `ci-pipeline-triage` when the proof workflow itself is failing, skipped, queued, or false green.