You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(rust): replace .expect("TODO") with documented invariants (9 sites)
9 prod sites in src/main.rs + src/api/mod.rs were carrying the
.expect("TODO: handle error") anti-pattern. Each gets a documented
invariant message that doubles as a SPARK proof candidate per the
estate-wide Rust/SPARK direction:
- 7 serde_json::to_string_pretty(&typed_value) sites: invariant
"serializing a typed Rust value to JSON is infallible (no Serialize
impl can fail)" — Serialize derive on owned structs cannot fail.
- 1 LAST_REQUEST mutex .lock() site: invariant "LAST_REQUEST mutex
never poisons — its critical section is sleep + assignment with no
panic-able operations".
- 1 std::fs::write site reusing the same serde invariant.
cargo check: clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
std::fs::write(&path, serde_json::to_string_pretty(&report).expect("serializing a typed Rust value to JSON is infallible (no Serialize impl can fail)"))
302
302
.map_err(|e| format!("Failed to write report to {}: {}", path, e))?;
0 commit comments