stemedb/.agentive-remediation/lint-enforcement-upgrade/history.md
jordan 3cfaa1e1d3 feat: Complete Phase 1 (The Spine) - storage foundation
Phase 1 delivers the complete durability and storage layer:

- WAL with crash recovery: Append-only journal with BLAKE3 checksums,
  fsync guarantees, and proper seek-to-EOF on reopen
- Storage engine: sled-backed KVStore with scan_prefix for range queries
- Content-addressed storage: H:{hash}, V:{hash}, E:{hash} key patterns
- Ingestor: Background worker tailing WAL, writing to KV with 8-byte
  aligned record headers for rkyv zero-copy deserialization
- Comprehensive tests: 31 tests covering crash recovery, round-trips,
  and multi-cycle durability

New crates: stemedb-wal, stemedb-storage, stemedb-ingest

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:15:34 -07:00

69 lines
1.6 KiB
Markdown

# lint-enforcement-upgrade
## AUDIT (2026-01-31)
### Original Concern
Error handling audit flagged expect()/unwrap() in:
- `crates/stemedb-core/src/lib.rs` (9 occurrences)
- `crates/stemedb-storage/src/sled_backend.rs` (5 occurrences)
- `crates/stemedb-wal/src/durability.rs` (23 occurrences)
- `crates/stemedb-wal/src/format.rs` (5 occurrences)
### Analysis
**All 42 occurrences are in `#[cfg(test)]` blocks.**
The `clippy.toml` correctly configures:
```toml
allow-unwrap-in-tests = true
allow-expect-in-tests = true
allow-panic-in-tests = true
```
**Production code is clean.** No actual error handling issue.
### Real Issue Found
`Cargo.toml` workspace lints are at `warn` level:
```toml
[workspace.lints.clippy]
unwrap_used = "warn"
expect_used = "warn"
panic = "warn"
```
This means:
1. CI currently passes even with violations
2. New production code could introduce expect()/unwrap()
3. Protection will drift
### Solution
Upgrade to `deny` to fail CI on violations. The clippy.toml test exceptions will still apply.
---
## FIX
- [x] Cargo.toml - upgraded lints from warn to deny (2026-01-31)
- `unwrap_used = "deny"`
- `expect_used = "deny"`
- `panic = "deny"`
## VERIFY
- [x] `cargo clippy --workspace -- -D warnings` - PASSED
- [x] `cargo test --workspace` - PASSED (11 tests)
## ENFORCE (2026-01-31)
- [x] CLAUDE.md - enhanced "No Unwrap" rule to mention enforcement mechanism
## DOCUMENT (2026-01-31)
- [x] .claude/guides/local/quality-checks.md - added "Enforced Lints" section explaining:
- Which lints are at deny level
- Why tests are exempt
- How to add new enforced lints
## COMPLETE
All phases executed successfully.