1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// kani_proofs.rs
// Copyright © 2024-2026 RustLogs (RLG). All rights reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//
// Kani model-checked proofs. Only compiled under `--cfg kani`,
// which the `cargo kani` invocation sets automatically.
//
// See `docs/adr/0004-kani-verified-invariants.md`.
use crateLogLevel;
use ;
/// The 11 LogLevel variants map to numeric values 0..=10. Kani
/// exhaustively verifies that `from_numeric(to_numeric(x)) == Some(x)`
/// for every representable input via symbolic execution.
/// Values outside [0, 10] must produce `None`. This proves the
/// `from_numeric` guard clause is exhaustive.
/// A monotonic counter's fetch_add produces distinct successive
/// values under any non-wraparound execution. This proves the
/// contract the `SESSION_COUNTER` in `crate::log` relies on.
///
/// Kani models `AtomicU64::fetch_add` faithfully for
/// single-threaded execution; the wraparound case is bounded away
/// by the assume clause because we care about the practical
/// invariant, not overflow behaviour.