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
deep debt V: complete unsafe hardening, env centralization, panic elimination
S282 comprehensive deep debt pass:
- Migrated last libc::mmap/munmap to rustix::mm in rm_trigger.rs
- Closed all 28 unsafe SAFETY doc gaps across 12 files
- Evolved 4 production panic paths to Result propagation
- Added 56 new socket_env constants, migrated 110 raw env::var sites
- Fixed 8 cylinder lib + 13 server clippy errors
- Evolved PatchStrategy::from_str to idiomatic impl FromStr
- Full workspace: zero libc, zero clippy, 178 lib tests pass
Co-authored-by: Cursor <cursoragent@cursor.com>
Comprehensive deep debt pass: libc::mmap→rustix::mm migration, all 28 unsafe SAFETY doc gaps closed, 4 production panic paths evolved to Result propagation, 110→~0 raw env::var sites (56 new socket_env constants, 110 sites migrated across 46 files), 8 pre-existing clippy errors fixed, full workspace clippy -D warnings clean.
13
+
14
+
-**MIGRATED**: `rm_trigger.rs` BAR0 mmap — all `libc::mmap`/`libc::munmap` evolved to `rustix::mm::mmap`/`rustix::mm::munmap`. Zero `libc::` references remain in workspace.
-**FIXED**: 13 clippy warnings in toadstool-server: dead code annotations, redundant closures → function pointers, `.clone()` on Copy type → deref
21
+
-**EVOLVED**: `PatchStrategy::from_str` → proper `impl std::str::FromStr` with `.parse()` at call site (idiomatic Rust)
22
+
- METRICS: ~410+ env reads via socket_env:: constants (~97%), <10 raw remaining. Zero `libc`. Zero unsafe without SAFETY docs. Zero production panics in lib. 178 lib tests pass, 0 clippy warnings across full workspace.
Comprehensive deep debt audit and execution across all dimensions: dependencies (libc→rustix), unsafe (panic elimination, SAFETY comments), env centralization (47 more sites migrated + 33 new constants), workspace dependency consolidation (rustix unified across 10 crates), and diagnostic bin hardening.
27
+
28
+
-**ELIMINATED**: `libc` dependency from `toadstool-cylinder` — last direct C crate on core hardware path. `rm_trigger.rs` fully evolved from `libc::ioctl` to `rustix::ioctl::Ioctl` trait pattern (matching VFIO ioctl.rs design). New `RmIoctl<OP, T>` adapter with documented SAFETY contracts.
29
+
-**FIXED**: `bar_cartography.rs:499` — P0 production panic path `.expect()` → `if let Some(bp)` guard (BAR diff logic in sovereign GPU diagnostics)
30
+
-**HARDENED**: 3 diagnostic bins — added per-block `// SAFETY:` comments to all `unsafe` in `sovereign_pmu_boot.rs`, `sovereign_acr_boot.rs`, `capture_pmu_falcon.rs` (mmap, read_volatile, write_volatile, munmap). Added `/// # Safety` doc contracts on `Bar0::map()`.
31
+
-**EVOLVED**: `rm_trigger.rs` — modernized to idiomatic Rust 2024: `&raw const`/`&raw mut` pointers, struct initialization via block expressions, `impl AsFd` instead of `RawFd`, removed all `borrow_as_ptr` lint violations
32
+
-**CONSOLIDATED**: `rustix` workspace dependency — unified 10 inline version pins (`"1"`, `"1.1"`) to `{ workspace = true }` across cli, hw-learn, hw-safe, nvpmu, sysmon, monitoring, akida-driver, display, secure_enclave, sandbox. All now resolve to workspace `1.1.4`.
33
+
-**EXPANDED**: `socket_env.rs` — +33 new env var constants: environment/runtime mode (TOADSTOOL_ENVIRONMENT, ENVIRONMENT, ENV, HOST, DISPLAY, WAYLAND_DISPLAY), discovery infra (TOADSTOOL_DISCOVERY_CONFIG, FALLBACK_PORT/ENABLED, SERVICE_DIR, REGISTRY_ENDPOINT, BIOMEOS_RUNTIME_DIR), service URLs (COORDINATION/CRYPTO/STORAGE/AI_SERVICE_URL, COORDINATOR, STORAGE, SERVICES), K8s/container (KUBERNETES_SERVICE_HOST, POD_NAMESPACE, COMPOSE_PROJECT_NAME, CONSUL_HTTP_ADDR, ETCD_ENDPOINTS), deprecated legacy (BEARDOG_FAMILY_SEED)
0 commit comments