Commit 5ca83e2
feat(verus): verified StaticVec proofs pass via Bazel — 13 verified, 0 errors
Update the Verus proof model to use proof-mode operations throughout,
matching the verified pattern that passes rust_verify. Add Bazel
integration via MODULE.bazel and BUILD.bazel targets.
Key changes:
- All operations (new, push, pop, clear) are proof fn, not exec fn,
since the model exists purely for verification
- Ghost fields use direct assignment in proof mode (no Ghost wrapper)
- Arithmetic casts with `as usize` for proof-mode int→usize conversion
- MODULE.bazel pins rules_verus with rust_verify direct invocation
- BUILD.bazel defines verus_test target for CI integration
- .gitignore updated for Bazel output directories
Verified properties (all unbounded — proved for ALL inputs):
1. Capacity invariant: len <= N always maintained
2. Push correctness: appends exactly one element
3. Push-full rejection: returns Err without mutation
4. Pop correctness: returns last pushed element (LIFO)
5. Push-pop inverse: push(x); pop() restores original state
6. Get bounds safety: get(i) returns Some iff i < len
7. Clear correctness: empties vector, preserves well-formedness
8. Length bounded by capacity: core ASIL-D invariant
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 874c27b commit 5ca83e2
File tree
5 files changed
+171
-209
lines changed- kiln-foundation/src/verus_proofs
5 files changed
+171
-209
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | 59 | | |
53 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments