Skip to content

Commit 268e82b

Browse files
westgatewestgate
authored andcommitted
S211: lint reason evolution + dep unification + feature cleanup + hw-safe expect→Result
Lint evolution: ~30 production #[expect] attrs evolved to include reason="..." across 25 files. Trailing // comments converted to structured reason parameter. Dependency unification: runtime/edge tokio/serde/uuid and akida-driver tokio dev-dep converted to { workspace = true }. Feature cleanup: removed stale empty flags — pure-rust (cli), industrial and embedded-hw (specialty). All had zero cfg gates in source. hw-safe expect→Result: HugePageMemory and DeviceMmap null-pointer checks after mmap now return NullPointer error variant instead of panicking. 7,842 lib tests, 0 failures, clippy -D warnings clean, fmt clean. Made-with: Cursor
1 parent 4a89a22 commit 268e82b

36 files changed

Lines changed: 136 additions & 55 deletions

File tree

DEBT.md

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

3-
**Date**: April 2026 — S210
3+
**Date**: April 2026 — S211
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+
**S211 (Deep Debt — Lint Reason + Dep Unification + Feature Cleanup + hw-safe Expect→Result)**:
12+
Completed comprehensive lint evolution: all remaining production `#[expect]`
13+
attributes evolved to include `reason = "..."` (~30 sites across 25 files).
14+
Workspace dependency unification: `tokio`, `serde`, `uuid` in `runtime/edge`
15+
and `tokio` dev-dep in `akida-driver` converted to `{ workspace = true }`.
16+
Stale feature flags removed: `pure-rust` (cli), `industrial`, `embedded-hw`
17+
(specialty). hw-safe `expect()` calls evolved to `Result`: `HugePageMemory`
18+
and `DeviceMmap` null-pointer post-mmap checks now return `NullPointer` error
19+
variant instead of panicking. **7,842 lib-only** tests, 0 failures, clippy
20+
clean, fmt clean.
21+
1122
**S210 (PG-46: BTSP Handshake Timeout)**:
1223
Added bounded timeouts to JSON-line BTSP handshake relay. Total handshake
1324
budget: 5s default (`BTSP_HANDSHAKE_TIMEOUT_SECS`). Per-BearDog-RPC budget:

NEXT_STEPS.md

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

3-
**Updated**: April 2026 — S210 (PG-46: BTSP Handshake Timeout)
4-
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-or-later** | **All quality gates green** | **7,842 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 panics/expects** | 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** | **BTSP handshake bounded** (5s default, PG-46, S210) | **All lint attrs with reason (S209)** | **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)**
5-
**Latest**: S210PG-46: BTSP Handshake Timeout. Added bounded timeouts to JSON-line BTSP handshake relay: 5s total budget (`BTSP_HANDSHAKE_TIMEOUT_SECS`), 3s per BearDog RPC (`BTSP_RPC_TIMEOUT_SECS`). `UnixJsonRpcClient::call_with_timeout` added. `BtspJsonLineError::Timeout` variant. Resolves short-timeout reads returning empty responses. **7,842 lib-only** tests, 0 failures, clippy clean, fmt clean.
3+
**Updated**: April 2026 — S211 (Deep Debt — Lint Reason + Dep Unification + Feature Cleanup + hw-safe Expect→Result)
4+
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-or-later** | **All quality gates green** | **7,842 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 panics/expects** | 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** | **BTSP handshake bounded** (5s default, PG-46, S210) | **All lint attrs with reason (S211)** | **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)**
5+
**Latest**: S211Deep Debt: Lint reason evolution (~30 production `#[expect]` attrs), workspace dep unification (edge `tokio`/`serde`/`uuid`, akida-driver `tokio`), stale feature cleanup (`pure-rust`, `industrial`, `embedded-hw`), hw-safe `expect()``Result` (`HugePageMemory` + `DeviceMmap` null-pointer checks). **7,842 lib-only** tests, 0 failures, clippy clean, fmt clean.
66

77
---
88

crates/cli/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,6 @@ npu = ["dep:akida-driver"]
140140
# Nautilus: proxied to barraCuda via capability-based IPC (zero library dep)
141141
nautilus = []
142142

143-
# PURE RUST: Build without C dependencies (no WASM, minimal features)
144-
pure-rust = []
145-
146143
[lints]
147144
workspace = true
148145

crates/cli/src/ecosystem/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl ServiceDiscoveryConfig {
185185
/// Uses capability-based endpoint discovery: Unix socket paths from
186186
/// biomeOS runtime directory. Services are discovered at runtime via
187187
/// well-known capability constants (primal_identity, ecosystem).
188-
#[expect(deprecated)] // Intentional: IPC addressing requires well-known names
188+
#[expect(deprecated, reason = "IPC addressing requires well-known names")]
189189
pub fn create_example() -> Self {
190190
use toadstool_common::constants::ecosystem::well_known;
191191
use toadstool_common::primal_sockets::get_biomeos_dir;

crates/cli/src/ecosystem/integrator_impl.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,7 @@ impl EcosystemIntegrator {
235235
.context(format!("Invalid endpoint: {endpoint}"))?;
236236

237237
// Store connection (capability-based, not hardcoded)
238-
// ServiceConnection requires deprecated EcosystemService enum during migration
239-
#[expect(deprecated)]
238+
#[expect(deprecated, reason = "ServiceConnection uses deprecated EcosystemService during migration")]
240239
let connection = ServiceConnection {
241240
endpoint: ServiceEndpoint {
242241
service_type: EcosystemService::Discovery,
@@ -338,8 +337,7 @@ impl EcosystemIntegrator {
338337
.context(format!("Invalid endpoint: {endpoint}"))?;
339338

340339
// Store connection (capability-based, not hardcoded)
341-
// ServiceConnection requires deprecated EcosystemService enum during migration
342-
#[expect(deprecated)]
340+
#[expect(deprecated, reason = "ServiceConnection uses deprecated EcosystemService during migration")]
343341
let connection = ServiceConnection {
344342
endpoint: ServiceEndpoint {
345343
service_type: EcosystemService::Storage,

crates/cli/src/ecosystem/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ mod connection;
2929
pub mod discovery;
3030

3131
// Public re-exports
32-
#[expect(deprecated)] // Re-exporting deprecated EcosystemService for backward compatibility
32+
#[expect(
33+
deprecated,
34+
reason = "re-exporting deprecated EcosystemService for backward compatibility"
35+
)]
3336
pub use types::{
3437
BearDogPermission, CryptoVerificationContext, DiscoveredService, DiscoveryResult,
3538
EcosystemIntegrator, EcosystemService, NestGateMount, SecurityPermission, ServiceEndpoint,

crates/cli/src/ecosystem/types/discovery.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ pub struct DiscoveryResult {
2323

2424
/// Service discovered during a scan
2525
#[derive(Debug, Clone, Serialize, Deserialize)]
26-
#[expect(deprecated)] // Using ServiceType during migration period
26+
#[expect(
27+
deprecated,
28+
reason = "ServiceType used during migration to capability-based discovery"
29+
)]
2730
pub struct DiscoveredService {
2831
/// Capability type (discovery, crypto, storage, compute)
2932
pub service_type: ServiceType,
@@ -57,7 +60,10 @@ pub enum ServiceType {
5760
Generic,
5861
}
5962

60-
#[expect(deprecated)] // ServiceType impl; deprecated during migration to capability-based discovery
63+
#[expect(
64+
deprecated,
65+
reason = "ServiceType impl deprecated during migration to capability-based discovery"
66+
)]
6167
impl ServiceType {
6268
/// Map to capability name
6369
pub const fn to_capability(&self) -> &'static str {

crates/cli/src/ecosystem/types/endpoint.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ use std::sync::Arc;
77

88
/// Discovered ecosystem service endpoint
99
#[derive(Debug, Clone)]
10-
#[expect(deprecated)] // ServiceEndpoint still uses EcosystemService for backward compatibility
10+
#[expect(
11+
deprecated,
12+
reason = "ServiceEndpoint uses deprecated EcosystemService for backward compatibility"
13+
)]
1114
pub struct ServiceEndpoint {
1215
/// Service capability type (discovery, crypto, storage)
1316
pub service_type: EcosystemService,
@@ -45,7 +48,10 @@ impl<'de> Deserialize<'de> for ServiceEndpoint {
4548
D: Deserializer<'de>,
4649
{
4750
#[derive(Deserialize)]
48-
#[expect(deprecated)] // EcosystemService is deprecated but still used for backward compat
51+
#[expect(
52+
deprecated,
53+
reason = "EcosystemService is deprecated but still used for backward compat"
54+
)]
4955
struct ServiceEndpointHelper {
5056
service_type: EcosystemService,
5157
address: SocketAddr,
@@ -88,7 +94,7 @@ pub enum EcosystemService {
8894
Unknown(String),
8995
}
9096

91-
#[expect(deprecated)] // Implementation of deprecated EcosystemService
97+
#[expect(deprecated, reason = "implementation of deprecated EcosystemService")]
9298
impl EcosystemService {
9399
/// Capability string for this service type
94100
pub(crate) fn name(&self) -> &str {

crates/cli/src/templates/basic_templates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use std::collections::HashMap;
1818
use toadstool_config::env_config::EnvironmentConfig;
1919

20-
#[expect(deprecated)] // Protocol compatibility: default PKI image
20+
#[expect(deprecated, reason = "protocol compatibility: default PKI image")]
2121
use toadstool_common::constants::ecosystem::well_known::BEARDOG;
2222

2323
use crate::{

crates/core/common/src/capability_provider/provider.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,10 @@ impl CapabilityProvider {
8181
let client = {
8282
let mut client_lock = self.client.write().await;
8383

84-
#[expect(clippy::option_if_let_else)]
85-
// map_or_else would cause borrow conflict with mutation
84+
#[expect(
85+
clippy::option_if_let_else,
86+
reason = "map_or_else would cause borrow conflict with mutation"
87+
)]
8688
if let Some(c) = client_lock.as_ref() {
8789
c.clone()
8890
} else {

0 commit comments

Comments
 (0)