Skip to content

Commit c8de8c7

Browse files
westgatewestgate
authored andcommitted
S209: deep debt — lint reason attrs + dep unification + auth capability evolution
Phase 1 — Lint evolution: all remaining crate-level #![allow] attrs given reason= (7 crates: specialty embedded, akida-models, native, testing). ~30 production #[expect(deprecated)]/#[allow(deprecated)] upgraded with reason= across config, auth, ecosystem, storage, GPU backends, and CLI. 3 test #[allow(clippy::float_cmp)] in server/mocks converted to reason=. Phase 2 — Workspace dep unification: sha2 (5 crates), serde_json (4), tracing-subscriber (4), tokio-test (10), tracing+thiserror (edge) all converted from pinned versions to { workspace = true } in 23 Cargo.toml. Phase 3 — Stale feature cleanup: removed unused ai-ml and squirrel-preparation placeholder features from excluded runtime/python. Phase 4 — Auth backend capability evolution: hardcoded well_known::BEARDOG issuer fallback replaced with capabilities::CRYPTO. Auth backend no longer imports or references any specific primal name. Unfulfilled #![expect(deprecated)] removed. Test fixtures updated. 7,842 lib-only tests, 0 failures, clippy clean (-D warnings), fmt clean. Made-with: Cursor
1 parent adc4f4f commit c8de8c7

69 files changed

Lines changed: 510 additions & 364 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.

DEBT.md

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

3-
**Date**: April 2026 — S208
3+
**Date**: April 2026 — S209
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+
**S209 (Deep Debt — Lint Reason + Dep Unification + Auth Capability)**:
12+
Completed comprehensive lint evolution: all remaining crate-level `#![allow]`
13+
attrs evolved to include `reason =` (7 embedded/neuromorphic/native/testing
14+
crates). ~30 production `#[expect(deprecated)]` / `#[allow(deprecated)]`
15+
attrs upgraded with `reason =`. Workspace dependency unification: `sha2`,
16+
`serde_json`, `tracing`, `thiserror`, `tracing-subscriber`, `tokio-test`
17+
converted to `{ workspace = true }` in 23 Cargo.toml files. Auth backend
18+
evolved: hardcoded `well_known::BEARDOG` issuer fallback replaced with
19+
capability-based `capabilities::CRYPTO`. Stale feature flags removed from
20+
excluded `runtime/python` crate (`ai-ml`, `squirrel-preparation`).
21+
**7,842 lib-only** tests, 0 failures, clippy clean, fmt clean.
22+
1123
**S208 (Deep Debt — Unsafe Allow + Feature Hygiene + Expect→Result)**:
1224
Resolved **D-GLOWPLUG-ALLOW** (removed unnecessary `#[allow(unsafe_code)]`
1325
from `glowplug/mod.rs` — module contains no unsafe code),

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 — S208 (Deep Debt — Unsafe Allow + Feature Hygiene + 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** | **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)** | **Self-registration with Songbird (S207)**
5-
**Latest**: S208 — Deep Debt — Unsafe Allow + Feature Hygiene + Expect→Result: Removed unnecessary `#[allow(unsafe_code)]` from `glowplug/mod.rs`. 4 empty no-op CLI features (`ecosystem`/`universal`/`monitoring`/`templates`) removed; test modules ungated; `gpu-ai` comment corrected. `InputManager::subscribe_events` evolved from panic to `Result`. `ProtocolEngine::build_*` evolved from `expect()` to `Option::insert`. Transport handshake `expect` replaced with array indexing. Edge discovery ports 22/80/8080 extracted to `well_known_ports` constants. **7,842 lib-only** tests, 0 failures, clippy clean, fmt clean.
3+
**Updated**: April 2026 — S209 (Deep Debt — Lint Reason + Dep Unification + Auth Capability)
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** | **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 (S209)** | **test-mocks off by default (S206)** | **Self-registration with Songbird (S207)** | **Auth issuer capability-based (S209)**
5+
**Latest**: S209 — Deep Debt — Lint Reason + Dep Unification + Auth Capability: All remaining crate-level `#![allow]` attrs given `reason =` (7 crates). ~30 production `#[expect(deprecated)]`/`#[allow(deprecated)]` upgraded with `reason =`. 23 Cargo.toml files unified to workspace deps (`sha2`, `serde_json`, `tracing`, `thiserror`, `tracing-subscriber`, `tokio-test`). Auth backend: hardcoded `well_known::BEARDOG` issuer fallback → `capabilities::CRYPTO`. Stale python feature flags removed. **7,842 lib-only** tests, 0 failures, clippy clean, fmt clean.
66

77
---
88

crates/auto_config/src/hardware/gpu.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,10 @@ pub fn calculate_gpu_score(gpu_info: &[GpuInfo]) -> f64 {
203203
}
204204

205205
#[cfg(test)]
206-
#[allow(deprecated)]
206+
#[allow(
207+
deprecated,
208+
reason = "tests exercise legacy GPU config APIs pending migration"
209+
)]
207210
mod tests {
208211
use super::*;
209212

crates/cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ colored = "2.0"
9595

9696
# Encoding
9797
base64 = { workspace = true }
98-
sha2 = "0.10"
98+
sha2 = { workspace = true }
9999

100100
# barracuda removed S94b: nautilus methods are now proxied to barraCuda via
101101
# capability-based IPC (JSON-RPC over Unix socket). Zero library coupling.

crates/cli/src/commands/doctor/checks.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ async fn check_gpu_available() -> bool {
9090
}
9191
}
9292

93-
#[expect(deprecated)]
93+
#[expect(
94+
deprecated,
95+
reason = "health check uses legacy EcosystemService enum for status display"
96+
)]
9497
pub(crate) async fn check_ecosystem_health() -> EcosystemReport {
9598
let mut issues = vec![];
9699

crates/cli/src/ecosystem/adapters/universal.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ impl UniversalServiceAdapter {
134134

135135
match protocol.as_str() {
136136
"jsonrpc" | "unix" => self.invoke_jsonrpc(provider, request).await,
137-
#[expect(deprecated)]
137+
#[expect(
138+
deprecated,
139+
reason = "HTTP invoke kept for legacy providers; prefer unix/jsonrpc"
140+
)]
138141
"http" | "https" => self.invoke_http(provider, request).await,
139142
"grpc" => {
140143
tracing::error!(

crates/cli/src/ecosystem/discovery.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,10 @@ pub fn discover_from_config(capability_category: &str) -> Option<String> {
133133
///
134134
/// **Status**: Currently unused but part of capability-based architecture.
135135
/// Will be used when full capability routing is implemented.
136-
#[expect(deprecated)]
136+
#[expect(
137+
deprecated,
138+
reason = "bridges capability categories to legacy ServiceEndpoint types"
139+
)]
137140
pub async fn discover_service_by_capability(
138141
capability_category: &str,
139142
) -> Result<Vec<ServiceEndpoint>> {
@@ -226,7 +229,10 @@ fn parse_service_url(url: &str) -> Result<SocketAddr> {
226229
///
227230
/// Delegates to the production mDNS implementation in toadstool-core (uses mdns-sd).
228231
/// Discovery runs for 2 seconds, matching Bonjour browse behavior.
229-
#[expect(deprecated)]
232+
#[expect(
233+
deprecated,
234+
reason = "mDNS discovery returns legacy ServiceEndpoint types"
235+
)]
230236
async fn discover_via_mdns(capability_category: &str) -> Result<Vec<ServiceEndpoint>> {
231237
let mdns = match toadstool::discovery::MdnsDiscoveryService::new() {
232238
Ok(m) => m,

crates/cli/src/ecosystem/integrator_impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use tokio::time::timeout;
2626
use tracing::{info, warn};
2727

2828
// Legacy integration layer; uses deprecated EcosystemService for ServiceConnection migration
29-
#[expect(deprecated)]
29+
#[expect(deprecated, reason = "entire impl block wraps legacy EcosystemService; callers migrating to capability-based discovery")]
3030
impl EcosystemIntegrator {
3131
/// Create a new ecosystem integrator (legacy discovery layer)
3232
#[must_use]

crates/client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ default = []
5151
tarpc = ["dep:tarpc", "dep:tokio-util", "dep:bytes", "dep:toadstool-integration-protocols"]
5252

5353
[dev-dependencies]
54-
tokio-test = "0.4"
54+
tokio-test = { workspace = true }
5555
temp-env = { workspace = true }
5656

5757
[lints]

crates/core/common/src/infant_discovery/sources/service_mesh.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,10 @@ impl Default for ServiceMeshSource {
7878
}
7979

8080
impl EndpointSource for ServiceMeshSource {
81-
#[expect(deprecated)]
81+
#[expect(
82+
deprecated,
83+
reason = "resolve() matches on deprecated vendor-specific mesh variants"
84+
)]
8285
fn resolve(
8386
&self,
8487
service: &str,

0 commit comments

Comments
 (0)