Skip to content

Commit 3e91156

Browse files
westgatewestgate
authored andcommitted
S206: lint evolution, dep hygiene, feature cleanup, mock default policy
- All ~40 production bare #[allow(...)] evolved to #[allow(..., reason)] (17 unsafe_code modules + ~23 clippy/deprecated/async-fn-in-trait) - humantime-serde, rand, tokio-util, temp-env unified to workspace in 20+ Cargo.toml - GPU: spirv/jit/testing features + optional deps (spirv, cranelift-jit, wasmtime) removed - Testing: integration-tests/benchmarks features + wiremock dep removed - test-mocks removed from toadstool core default features; testing crate explicitly enables - 7,841 lib tests, 0 failures, clippy clean, fmt clean Made-with: Cursor
1 parent c7f1b73 commit 3e91156

60 files changed

Lines changed: 207 additions & 96 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ hkdf = "0.12"
166166
hmac = "0.12"
167167
chacha20poly1305 = "0.10"
168168
rand = "0.8"
169+
humantime-serde = "1.1"
169170

170171
# Networking
171172
# EVOLVED: ipnet removed (Mar 12, 2026) — unused; no crate references it
@@ -198,6 +199,7 @@ clap = { version = "4.4", features = ["derive", "env"] }
198199
# Development dependencies
199200
tokio-test = "0.4"
200201
tempfile = "3.8"
202+
temp-env = { version = "0.3", features = ["async_closure"] }
201203
criterion = { version = "0.5", features = ["html_reports"] }
202204
proptest = "1.4"
203205

DEBT.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
# Active Technical Debt Register
22

3-
**Date**: April 2026 — S205
3+
**Date**: April 2026 — S206
44
**Philosophy**: Math is universal, precision is silicon. Workarounds are
55
short-term solutions that increase debt. We aim to solve deep debt over
66
iterations, evolving toward vendor-agnostic, capability-based solutions—
77
with production stubs surfacing typed configuration errors and capability
88
guidance, and auth policy driven by explicit environment configuration
99
where applicable.
1010

11+
**S206 (Lint Evolution + Dep Hygiene + Feature Cleanup)**: Resolved **D-LINT-FULL**
12+
(all ~40 bare `#[allow(...)]` in production evolved to `#[allow(..., reason = "...")]`
13+
17 `unsafe_code` modules, ~23 clippy/deprecated/async-fn-in-trait allows), **D-DEP-UNIFIED**
14+
(`humantime-serde`, `rand`, `tokio-util`, `temp-env` unified to `{ workspace = true }` in 20+
15+
crate Cargo.toml files), **D-FEATURE-STALE** (GPU `spirv`/`jit`/`testing` features + deps
16+
removed; testing `integration-tests`/`benchmarks`/`wiremock` removed — none referenced in
17+
source), **D-MOCK-DEFAULT** (`test-mocks` removed from `toadstool` core default features —
18+
production builds no longer compile mock backends; testing crate explicitly enables it).
19+
7,841 lib tests, 0 failures, clippy and fmt clean.
20+
1121
**S205 (Phase 55 — Crypto + Discovery)**: Resolved **D-PLAINTEXT-DISPATCH**
1222
(compute payloads now encrypted via Tower `crypto.encrypt` before dispatch,
1323
decrypted via `crypto.decrypt` on result — graceful standalone fallback).

NEXT_STEPS.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# ToadStool -- Next Steps
22

3-
**Updated**: April 2026 — S205 (Phase 55 — Crypto + Discovery)
4-
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-or-later** | **All quality gates green** | **7,841 lib-only** tests verified (20,000+ workspace, 0 failures) | **~65 JSON-RPC methods** | Wire Standard L3 (partial) | Zero C FFI deps (ecoBin v3.0) | Zero production unwraps | IPC-first | workspace `unsafe_code = "deny"`, **41 crates `forbid`** | **49 unsafe blocks** (all in hw containment, all SAFETY-documented) | **0 production TODOs** | **rustix 1.x workspace-wide** | **capability-based primal references (no hardcoded names)** | **`async-trait` DEPRECATED** (banned in `deny.toml`) | **`deny.toml` ring + async-trait + zstd-sys bans active** | **env centralized via config structs** | **real Linux sandbox (rustix)** | **real resource metrics (cgroup v2/proc)** | **plugin loading (libloading)** | **binary tarpc framing (MessagePack)** | **BTSP JSON-line relay (Phase 45c)** | **Display Phase 2 (petalTongue IPC)** | **Encrypted compute dispatch (Phase 55)**
5-
**Latest**: S205Phase 55 (Crypto + Discovery): compute payloads encrypted via Tower `crypto.encrypt` before dispatch, decrypted on result return (graceful standalone fallback). `DISCOVERY_SOCKET` wired as highest-precedence tier for capability resolution. `secrets.retrieve` purpose key delegation via `SecurityClient`. **7,841 lib-only** tests, 0 failures, clippy clean, fmt clean.
3+
**Updated**: April 2026 — S206 (Lint Evolution + Dep Hygiene + Feature Cleanup)
4+
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-or-later** | **All quality gates green** | **7,841 lib-only** tests verified (20,000+ workspace, 0 failures) | **~65 JSON-RPC methods** | Wire Standard L3 (partial) | Zero C FFI deps (ecoBin v3.0) | Zero production unwraps | IPC-first | workspace `unsafe_code = "deny"`, **41 crates `forbid`** | **49 unsafe blocks** (all in hw containment, all SAFETY-documented) | **0 production TODOs** | **rustix 1.x workspace-wide** | **capability-based primal references (no hardcoded names)** | **`async-trait` DEPRECATED** (banned in `deny.toml`) | **`deny.toml` ring + async-trait + zstd-sys bans active** | **env centralized via config structs** | **real Linux sandbox (rustix)** | **real resource metrics (cgroup v2/proc)** | **plugin loading (libloading)** | **binary tarpc framing (MessagePack)** | **BTSP JSON-line relay (Phase 45c)** | **Display Phase 2 (petalTongue IPC)** | **Encrypted compute dispatch (Phase 55)** | **All lint attrs with reason (S206)** | **test-mocks off by default (S206)**
5+
**Latest**: S206Lint Evolution + Dep Hygiene + Feature Cleanup: All ~40 production bare `#[allow(...)]` evolved to `#[allow(..., reason)]` (17 `unsafe_code`, ~23 clippy/deprecated). `humantime-serde`, `rand`, `tokio-util`, `temp-env` unified to workspace in 20+ Cargo.toml files. GPU `spirv`/`jit`/`testing` + testing `integration-tests`/`benchmarks`/`wiremock` stale features and deps removed. `test-mocks` removed from core default features. **7,841 lib-only** tests, 0 failures, clippy clean, fmt clean.
66

77
---
88

@@ -163,7 +163,14 @@ names directly. Deprecated API definitions retained for backward compatibility o
163163

164164
---
165165

166-
## Completed This Session (S90-S205)
166+
## Completed This Session (S90-S206)
167+
168+
### Session S206: Lint Evolution + Dep Hygiene + Feature Cleanup (Apr 28, 2026)
169+
- **Lint evolution** — All ~40 production bare `#[allow(...)]` evolved to `#[allow(..., reason = "...")]`: 17 `unsafe_code` module allows in hw-safe/gpu/display/plugin crates, plus ~23 clippy/deprecated/async_fn_in_trait allows across auto_config, cli, distributed, integration, management, neuromorphic, runtime, security crates.
170+
- **Dependency unification**`humantime-serde`, `rand`, `tokio-util`, `temp-env` added to `[workspace.dependencies]` and 20+ crate Cargo.toml files updated to `{ workspace = true }`.
171+
- **Stale feature removal** — GPU crate: `spirv`/`jit`/`testing` features and optional deps (`spirv`, `cranelift-jit`, `wasmtime`) removed (never referenced in source). Testing crate: `integration-tests`/`benchmarks` features and `wiremock` dep removed.
172+
- **`test-mocks` off by default** — removed from `toadstool` core `default` features; production builds no longer compile `InMemoryAuthBackend`/`InMemoryAgentBackend`. Testing crate explicitly enables via `features = ["test-mocks"]`.
173+
- 7,841 lib tests, 0 failures, clippy clean, fmt clean.
167174

168175
### Session S205: Phase 55 — Encrypted Compute Dispatch + Discovery Socket (Apr 28, 2026)
169176
- **Encrypted compute dispatch**`DispatchHandler` now optionally holds a Tower `SecurityClient`; when present (NUCLEUS composition), payloads are encrypted via `crypto.encrypt` with the `compute` purpose key before dispatch to coralReef, and results are decrypted via `crypto.decrypt` on return. Standalone mode (no BearDog) continues with plaintext dispatch.

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ Nest = Tower + Storage <- storage
4545
| `cargo test --workspace` | **20,000+ tests, 0 failures** (7,841 lib-only verified S205), **~93** ignored (hardware-gated); full workspace ~3m30s |
4646
| Doctests | All passing (common, core, server, cli, testing, display) |
4747
| Standalone clone test | Pull to any machine, `cargo test` works (GPU-optional, CPU fallback, device-lost resilient) |
48-
| `unsafe` blocks | **49 actual** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented (S204); workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]` |
48+
| `unsafe` blocks | **49 actual** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented (S204); workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]`; **all ~40 production `#[allow]` have `reason =`** (S206) |
4949
| Production panics/unwraps | **0** production `unwrap()` / `expect()` / `panic!()` |
50-
| Production stubs / test mocks | Stubs evolved to real implementations (edge USB/BT/IPv6, scheduler queuing, monitoring via sysmon+statvfs); **auth test mocks** (`InMemoryAuthBackend`) isolated under **`#[cfg(any(test, feature = "test-mocks"))]`** |
50+
| Production stubs / test mocks | Stubs evolved to real implementations (edge USB/BT/IPv6, scheduler queuing, monitoring via sysmon+statvfs); **auth test mocks** (`InMemoryAuthBackend`) isolated under **`#[cfg(any(test, feature = "test-mocks"))]`**; **`test-mocks` removed from default features** (S206 — production builds exclude mock code) |
5151
| Production `Box<dyn Error>` | 0 in core crates -- all typed errors (thiserror) |
5252
| Production TODOs / FIXME / HACK | 0 in production code |
5353
| Dead code | ~400+ lines removed (REST, middleware, dead modules); **~80** justified `#[allow]` remain (conditional compilation, deprecated compat) |
@@ -275,6 +275,7 @@ toadStool/
275275
- **NUCLEUS crypto integration** -- compute payloads encrypted via Tower `crypto.encrypt`/`crypto.decrypt` (S205); next: primal self-registration with Songbird (`ipc.register`)
276276

277277
### Recently Completed
278+
- **S206 (Apr 28, 2026)**: **Lint Evolution + Dep Hygiene + Feature Cleanup** — All ~40 production bare `#[allow(...)]` evolved to `#[allow(..., reason)]` (17 `unsafe_code`, ~23 clippy/deprecated). `humantime-serde`, `rand`, `tokio-util`, `temp-env` unified to `{ workspace = true }` in 20+ Cargo.toml files. GPU `spirv`/`jit`/`testing` + testing `integration-tests`/`benchmarks`/`wiremock` stale features/deps removed. `test-mocks` removed from core default features (production builds no longer compile mock backends). 7,841 lib tests, 0 failures, clippy clean.
278279
- **S205 (Apr 28, 2026)**: **Phase 55 — Encrypted Compute Dispatch + Discovery Socket** — compute job payloads encrypted via Tower `crypto.encrypt` before dispatch, decrypted on result return (graceful standalone fallback). `DISCOVERY_SOCKET` env var wired as highest-precedence tier for capability resolution. `secrets.retrieve` purpose key delegation. 7,841 lib tests, 0 failures, clippy clean.
279280
- **S176 (Apr 23, 2026)**: **BTSP JSON-line handshake relay** (primalSpring Phase 45c) — JSON-line BTSP auto-detection on `0x7B` first-byte path across all three connection handlers (pure JSON-RPC, tarpc, daemon). New `btsp/json_line.rs` with `relay_json_line_handshake()` (4-step BearDog IPC relay), `btsp/family_seed.rs` with `load_family_seed_for_btsp()` (env→file cascade, base64/hex/raw normalization), security socket discovery via env cascade. `PrependByte` extracted to `btsp/framing.rs` for reuse. 7,809 lib tests, 0 failures, clippy clean.
280281
- **S175 (Apr 21, 2026)**: **Deep debt evolution**`NoopCryptoProvider` evolved to capability-based error guidance (matches `NoopCloudProvider` S174 pattern). 6 `eprintln!` calls migrated to `tracing` macros in `universal/capabilities.rs` (GPU adapter discovery diagnostics). 13 bare `#[allow]` evolved to `#[expect]` with reasons across distributed (gpu detection, federation, metrics), neuromorphic (pcie), management (performance). Preventive `#[allow]` with reasons kept for nvpmu (VFIO/power_manager casts) and server (handler `unused_async`). armv7 cross-arch clean. Clippy 0 warnings.
@@ -383,7 +384,7 @@ See [DEBT.md](DEBT.md) for full register and evolution paths.
383384

384385
---
385386

386-
**Last Updated**: April 2026 — S205 (Phase 55 — Crypto + Discovery). **20,000+** workspace tests, 0 failures (7,841 lib-only). ~83.6% lib-only line coverage (target 90%). **65 JSON-RPC methods** (direct) + semantic registry with **Wire Standard L3** (cost_estimates + operation_dependencies). AGPL-3.0-or-later. Zero C FFI deps (ecoBin v3.0). **49 unsafe blocks** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented (S204: ffi\_loader.rs gap closed); workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]`. IPC-first JSON-RPC (dual-socket: `compute.sock` + `compute-tarpc.sock`). Rust 1.85+ (edition 2024, MSRV). **async-trait DEPRECATED** — fully removed, banned in `deny.toml`. **env_overrides fully interned** (socket_env). Real monitoring (sysmon + statvfs). **BTSP Phase 2 + JSON-line relay** (primalSpring Phase 45c). **Display Phase 2** (petalTongue IPC: `display.present`, `display.subscribe_input`, `display.poll_events`). **Encrypted compute dispatch** (Phase 55: Tower crypto delegation). **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
387+
**Last Updated**: April 2026 — S206 (Lint Evolution + Dep Hygiene + Feature Cleanup). **20,000+** workspace tests, 0 failures (7,841 lib-only). ~83.6% lib-only line coverage (target 90%). **65 JSON-RPC methods** (direct) + semantic registry with **Wire Standard L3** (cost_estimates + operation_dependencies). AGPL-3.0-or-later. Zero C FFI deps (ecoBin v3.0). **49 unsafe blocks** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented (S204: ffi\_loader.rs gap closed); workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]`. IPC-first JSON-RPC (dual-socket: `compute.sock` + `compute-tarpc.sock`). Rust 1.85+ (edition 2024, MSRV). **async-trait DEPRECATED** — fully removed, banned in `deny.toml`. **env_overrides fully interned** (socket_env). Real monitoring (sysmon + statvfs). **BTSP Phase 2 + JSON-line relay** (primalSpring Phase 45c). **Display Phase 2** (petalTongue IPC: `display.present`, `display.subscribe_input`, `display.poll_events`). **Encrypted compute dispatch** (Phase 55: Tower crypto delegation). **All lint attrs with `reason =`** (S206). **`test-mocks` off default** (S206). **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
387388

388389
---
389390

crates/auto_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ regex = { workspace = true }
3737
[dev-dependencies]
3838
tokio-test = { workspace = true }
3939
tempfile = { workspace = true }
40-
temp-env = { version = "0.3.6", features = ["async_closure"] }
40+
temp-env = { workspace = true }
4141

4242
[features]
4343
default = []

crates/auto_config/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
#![forbid(unsafe_code)]
33
#![warn(missing_docs)]
4-
#![allow(clippy::doc_markdown)]
4+
#![allow(
5+
clippy::doc_markdown,
6+
reason = "technical identifiers pervasive in API docs"
7+
)]
58

69
//! # `ToadStool` Auto-Configuration Library
710
//!

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ url = { workspace = true }
109109

110110
[dev-dependencies]
111111
anyhow = "1"
112-
temp-env = { version = "0.3", features = ["async_closure"] }
112+
temp-env = { workspace = true }
113113
tempfile = { workspace = true }
114114
assert_cmd = "2.0"
115115
predicates = "3.0"

crates/cli/src/executor/lifecycle_ops/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
//! Split into submodules by concern:
55
//! - `start` — biome/primal/service startup, workload conversion
66
//! - `stop` — graceful/force shutdown, purge, signal handling
7-
#![allow(deprecated)]
7+
#![allow(
8+
deprecated,
9+
reason = "lifecycle ops reference deprecated config fields during migration"
10+
)]
811

912
mod start;
1013
mod stop;

crates/cli/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
#![forbid(unsafe_code)]
33
#![warn(missing_docs)]
4-
#![allow(deprecated)] // Intentional: IPC addressing requires well-known names
4+
#![allow(
5+
deprecated,
6+
reason = "IPC addressing requires well-known names during migration"
7+
)]
58
#![allow(
69
clippy::cast_possible_truncation,
710
clippy::cast_precision_loss,
@@ -39,7 +42,8 @@
3942
clippy::float_cmp,
4043
clippy::case_sensitive_file_extension_comparisons,
4144
clippy::assigning_clones,
42-
clippy::needless_raw_string_hashes
45+
clippy::needless_raw_string_hashes,
46+
reason = "CLI crate: pedantic lints suppressed crate-wide; numeric casts bounds-checked"
4347
)]
4448

4549
//! `ToadStool` CLI - Universal Compute Command Center

crates/cli/src/templates/specialized_templates/custom_templates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//!
44
//! Allows users to define custom biome configurations via CustomTemplateSpec.
55
6-
#![allow(deprecated)] // Module uses deprecated fields during migration
6+
#![allow(deprecated, reason = "module uses deprecated fields during migration")]
77

88
use std::collections::HashMap;
99

0 commit comments

Comments
 (0)