Skip to content

Commit 6c23a7e

Browse files
BiomeOS Developercursoragent
andcommitted
S226: deep debt audit — workspace clippy clean + lint hygiene
Full deep debt survey: zero production files >800 LOC, zero production TODOs/FIXMEs, all 46 unsafe blocks at kernel FFI with SAFETY docs, all mocks test-gated, all primal names intentional legacy compat. Fixed 8 clippy errors in integration-primals: 4 unused_async (removed async from sync fns), 2 redundant closures, 1 debug formatting (Display instead of Debug), 1 map_unwrap_or → map_or_else. Bare allow(dead_code) in distributed/network/metrics.rs given reason. deny.toml stale ring comment corrected. auto_config items_after_statements fixed (S225 carryover). Workspace cargo clippy --workspace -- -D warnings: zero errors. 22,843 workspace tests, 0 failures. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 90ba4e0 commit 6c23a7e

8 files changed

Lines changed: 25 additions & 21 deletions

File tree

DOCUMENTATION.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# ToadStool Documentation Hub
22

3-
**Last Updated**: May 2026 — S225
3+
**Last Updated**: May 2026 — S226
44

55
---
66

@@ -30,7 +30,7 @@ These root documents were **fully resolved** and **fossilized** in wateringHole
3030

3131
---
3232

33-
## Current State (S225 — May 2026)
33+
## Current State (S226 — May 2026)
3434

3535
**Post-budding, dependency-sovereign, IPC-first, fully concurrent, capability-based.** barraCuda is a separate primal at `ecoPrimals/barraCuda/`. ToadStool is the hardware infrastructure layer — GPU/NPU/CPU discovery, capability probing, workload orchestration, and shader dispatch.
3636

NEXT_STEPS.md

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

3-
**Updated**: May 2026 — S225 (PG-62: Health Liveness Fast-Path + Startup Reorder)
3+
**Updated**: May 2026 — S226 (Deep Debt Audit — Workspace Clippy Clean)
44
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-or-later** | **All quality gates green** | tests verified (22,843 workspace, 0 failures) | **~65 JSON-RPC methods** | Wire Standard L3 (partial) | Zero C FFI deps (ecoBin v3.0) | **Zero production panics/expects** | IPC-first | workspace `unsafe_code = "deny"`, **41 crates `forbid`** | **46 unsafe blocks** (all in hw containment, all SAFETY-documented, reconciled S221) | **0 production TODOs** | **rustix 1.x workspace-wide** | **capability-based primal references (no hardcoded names, S221)** | **`async-trait` DEPRECATED** (banned in `deny.toml`) | **`deny.toml` ring + async-trait + zstd-sys bans active** | **BTSP Phase 3 encrypted channel (ChaCha20-Poly1305, S215)** | **BTSP Phase 3 transport switch verified (S218)** | **BTSP handshake bounded + connection-reused** (PG-46 resolved, S214) | **All lint attrs with reason (S211+S213)** | **Auth issuer capability-based (S209)** | **Self-registration with Songbird (S207)** | **Encrypted compute dispatch (Phase 55)** | **Display Phase 2 (petalTongue IPC)** | **BTSP JSON-line relay (Phase 45c)** | **Orchestrator lock-panic-free (S213)** | **Health liveness fast-path (PG-62, S225)**
5-
**Latest**: S225 — PG-62: `health.liveness` fast-path returns `{"status":"starting"}` during initialization, `{"status":"alive"}` once ready. Discovery registration moved after listener spawn. Recommended caller timeout: ≥3s. BearDog `crypto.sign_contract` (PG-60+) tracked for Phase 60+. +5 tests. 22,843 tests, 0 failures.
5+
**Latest**: S226 — Deep debt audit: workspace `cargo clippy -- -D warnings` zero errors. 8 clippy errors in integration-primals fixed (unused_async, redundant closures, debug formatting). Bare `allow(dead_code)` given reason. `deny.toml` ring comment corrected.
6+
**Previous**: S225 — PG-62: `health.liveness` fast-path returns `{"status":"starting"}` during initialization, `{"status":"alive"}` once ready. Discovery registration moved after listener spawn. Recommended caller timeout: ≥3s. BearDog `crypto.sign_contract` (PG-60+) tracked for Phase 60+. +5 tests. 22,843 tests, 0 failures.
67

78
---
89

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ toadStool/
285285
- **NUCLEUS crypto integration** -- compute payloads encrypted via Tower `crypto.encrypt`/`crypto.decrypt` (S205); **self-registration with Songbird** via `DISCOVERY_SOCKET` + `ipc.register` at startup (S207)
286286

287287
### Recently Completed
288+
- **S226 (May 7, 2026)**: **Deep Debt Audit — Workspace Clippy Clean + Lint Hygiene** — Full deep debt survey: **zero** production files >800 LOC, **zero** production TODOs/FIXMEs, all 46 unsafe blocks at kernel FFI boundaries with SAFETY docs, all mocks test-gated, all primal names intentional legacy compat. Fixed 8 clippy errors in `integration-primals` (4 `unused_async` → removed `async`, 2 redundant closures, 1 debug formatting, 1 `map_unwrap_or`). Bare `#[allow(dead_code)]` in `distributed/network/metrics.rs` given reason. `deny.toml` stale `ring` comment corrected. `auto_config` `items_after_statements` fixed (S225). **Workspace `cargo clippy -- -D warnings`: zero errors.** 22,843 tests.
288289
- **S225 (May 7, 2026)**: **PG-62 — Health Liveness Fast-Path + Startup Reorder**`health.liveness` now returns `{"status":"starting"}` during initialization and `{"status":"alive"}` once fully ready (via `Arc<AtomicBool>` readiness flag). `health.readiness` likewise returns `"starting"``"ready"`. Discovery registration + biomeOS scan moved **after** listener spawn so the socket accepts connections immediately. Recommended caller timeout: **≥3 seconds** (documented). BearDog cross-family `crypto.sign_contract` (PG-60+) tracked for Phase 60+. +5 tests. 22,843 tests.
289290
- **S224 (May 7, 2026)**: **PG-55 — `--bind` Flag + Localhost Default (Security)** — Added `--bind host:port` CLI flag to `server`/`daemon` subcommands. Default TCP bind changed from `0.0.0.0` to `127.0.0.1`. Priority: CLI `--bind` > `TOADSTOOL_BIND_ADDRESS` env > localhost default. +5 tests. 22,838 tests.
290291
- **S223 (May 6, 2026)**: **Deep Debt — Smart Refactor + Sleep Elimination + Test Speed** — Smart-refactored `btsp/json_line.rs` (905→478 LOC + `relay.rs` 255 + `negotiate.rs` 189; zero files >800 LOC). Eliminated 4 test sleeps: `thread::sleep` → deterministic time manipulation (backdated timestamps, `tokio::time::pause`). Evolved `intrusion.rs` to `tokio::time::Instant` for testable time. Fixed `auto_config` ecosystem discovery blocking 10s on mDNS daemon startup/shutdown and DNS resolution in tests — `cfg!(test)` early-returns skip network I/O (237 tests: 10.02s→0.24s, 41x speedup). Confirmed zero production `unwrap()`. Stale `/tmp/ecoPrimals/discovery/` comments evolved to capability-based language. +12 tests (resource_validator/analysis). 22,833 tests.
@@ -410,7 +411,7 @@ See [DEBT.md](DEBT.md) for full register and evolution paths.
410411

411412
---
412413

413-
**Last Updated**: May 2026 — S225 (PG-62: Health Liveness Fast-Path + Startup Reorder). **22,843** workspace tests, 0 failures (7,884+ 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). **46 unsafe blocks** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented; workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]`. **Zero production panics/expects**. IPC-first JSON-RPC (dual-socket: `compute.sock` + `compute-tarpc.sock`). Rust 1.85+ (edition 2024, MSRV). **BTSP Phase 3 encrypted channel** (ChaCha20-Poly1305, S215; transport switch verified S218). **PG-46 resolved** (socket reuse, S214). **Self-registration** with Songbird via `DISCOVERY_SOCKET` (S207). **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
414+
**Last Updated**: May 2026 — S226 (Deep Debt Audit — Workspace Clippy Clean). **22,843** workspace tests, 0 failures (7,884+ 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). **46 unsafe blocks** (all in hw-safe/GPU/VFIO/display/plugin containment crates); all SAFETY-documented; workspace `unsafe_code = "deny"`, **41 crates `forbid`** + 5 hw crates with narrow `#[allow(unsafe_code, reason)]`. **Zero production panics/expects**. IPC-first JSON-RPC (dual-socket: `compute.sock` + `compute-tarpc.sock`). Rust 1.85+ (edition 2024, MSRV). **BTSP Phase 3 encrypted channel** (ChaCha20-Poly1305, S215; transport switch verified S218). **PG-46 resolved** (socket reuse, S214). **Self-registration** with Songbird via `DISCOVERY_SOCKET` (S207). **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
414415

415416
---
416417

crates/distributed/src/network/metrics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use tokio::sync::RwLock;
55

66
/// Network metrics collector for distributed execution
77
pub struct NetworkMetricsCollector {
8-
#[cfg_attr(not(test), allow(dead_code))]
8+
#[cfg_attr(not(test), allow(dead_code, reason = "stored for lifecycle; consumed in test assertions"))]
99
metrics: Arc<RwLock<NetworkMetricsData>>,
1010
}
1111

crates/integration/primals/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ impl PrimalClient {
5454
}
5555
} else if msg.contains("No such file") || msg.contains("not found") {
5656
PrimalError::ServiceUnavailable {
57-
service: format!("primal at {:?}", self.rpc_client.socket_path()),
57+
service: format!("primal at {}", self.rpc_client.socket_path().display()),
5858
}
5959
} else {
6060
PrimalError::Integration {
@@ -67,7 +67,7 @@ impl PrimalClient {
6767
// Parse result into PrimalResponse if it's an object with success/data/error
6868
let response = if let Some(obj) = result.as_object() {
6969
PrimalResponse {
70-
success: obj.get("success").and_then(|v| v.as_bool()).unwrap_or(true),
70+
success: obj.get("success").and_then(serde_json::Value::as_bool).unwrap_or(true),
7171
data: obj.get("data").cloned().unwrap_or(serde_json::Value::Null),
7272
error: obj
7373
.get("error")

crates/integration/primals/src/orchestrator.rs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,16 @@ impl PrimalOrchestrator {
9595
.data
9696
.get("deployment_id")
9797
.or_else(|| response.data.get("id"))
98-
.and_then(|v| v.as_str())
99-
.map(std::string::ToString::to_string)
100-
.unwrap_or_else(|| format!("deployed-{}", manifest.name));
98+
.and_then(serde_json::Value::as_str)
99+
.map_or_else(
100+
|| format!("deployed-{}", manifest.name),
101+
std::string::ToString::to_string,
102+
);
101103

102104
Ok(deployment_id)
103105
}
104106

105-
pub async fn register_primal(
107+
pub fn register_primal(
106108
&mut self,
107109
primal_id: String,
108110
primal: Box<dyn PrimalIntegration>,
@@ -111,8 +113,8 @@ impl PrimalOrchestrator {
111113
Ok(())
112114
}
113115

114-
pub async fn get_primal(&self, primal_id: &str) -> Option<&dyn PrimalIntegration> {
115-
self.primals.get(primal_id).map(|p| p.as_ref())
116+
pub fn get_primal(&self, primal_id: &str) -> Option<&dyn PrimalIntegration> {
117+
self.primals.get(primal_id).map(std::convert::AsRef::as_ref)
116118
}
117119
}
118120

@@ -198,9 +200,8 @@ mod tests {
198200
should_fail: false,
199201
};
200202
orch.register_primal("test".to_string(), Box::new(mock))
201-
.await
202203
.unwrap();
203-
assert!(orch.get_primal("test").await.is_some());
204-
assert!(orch.get_primal("nonexistent").await.is_none());
204+
assert!(orch.get_primal("test").is_some());
205+
assert!(orch.get_primal("nonexistent").is_none());
205206
}
206207
}

crates/integration/primals/src/services.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ impl ServiceManager {
3838
}
3939
}
4040

41-
pub async fn start_service(
41+
pub fn start_service(
4242
&mut self,
4343
service_id: String,
4444
service_type: String,
@@ -68,7 +68,7 @@ impl ServiceManager {
6868
Ok(())
6969
}
7070

71-
pub async fn stop_service(&mut self, service_id: &str) -> PrimalResult<()> {
71+
pub fn stop_service(&mut self, service_id: &str) -> PrimalResult<()> {
7272
if let Some(service) = self.services.get_mut(service_id) {
7373
service.status = ServiceStatus::Stopped;
7474
}

deny.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,9 @@ deny = [
7474
# OpenSSL — use rustls + aws-lc-rs / *ring* instead
7575
{ name = "openssl" },
7676
{ name = "openssl-sys" },
77-
# ring — C/asm crypto; use aws-lc-rs or other pure Rust alternatives
78-
# License clarified in [[licenses.clarify]]; verified absent from Cargo.lock (S203l).
77+
# ring — C/asm crypto; use aws-lc-rs or other pure Rust alternatives.
78+
# License clarified in [[licenses.clarify]]; not in resolved workspace graph
79+
# (stale lockfile entry may persist from older resolves — `cargo tree -i ring` returns empty).
7980
{ name = "ring" },
8081
# async-trait — proc macro for dyn-safe async traits; fully evolved to manual
8182
# Pin<Box<dyn Future>> and native AFIT (S203r). No workspace crate depends on it directly.

0 commit comments

Comments
 (0)