Skip to content

Commit 53f8af8

Browse files
westgatewestgate
authored andcommitted
S180: Deep debt — async I/O fix, 5 large file refactors, capability-first string evolution
- Fix blocking std::fs::read_dir in async platform detectors (tokio::fs) - Smart-refactor cross_gate.rs, infant_discovery/capabilities.rs, crypto_lock/validation.rs, runtime/mod.rs, configurator/core.rs - Evolve primal-name strings in 8 production files to capability-first (Songbird→coordination, BearDog→security/crypto, NestGate→storage, Squirrel→AI/routing) - Update test assertions for evolved error messages - 21,853 tests, 0 failures, Clippy clean Made-with: Cursor
1 parent b88cd44 commit 53f8af8

46 files changed

Lines changed: 3402 additions & 3128 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.

CHANGELOG.md

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,32 @@ All notable changes to ToadStool will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased] - April 4, 2026 (Sessions 43-177)
8+
## [Unreleased] - April 4, 2026 (Sessions 43-180)
9+
10+
### Session S180 (Apr 4, 2026) — Deep Debt Evolution: Async I/O, Refactoring, String Evolution
11+
12+
#### Async I/O Fix (1 file)
13+
- Replaced blocking `std::fs::read_dir` with `tokio::fs::read_dir` in 2 async platform detectors
14+
(`detect_neuromorphic_platforms`, `detect_edge_iot_platforms` in `distributed/universal/detection`)
15+
16+
#### Large File Smart Refactoring (5 files)
17+
- `server/cross_gate.rs` (660L) → `cross_gate/{mod,types,dispatcher,router,tests}.rs`
18+
- `common/infant_discovery/capabilities.rs` (658L) → `capabilities/{mod,discovered,discovery_traits,substrate,endpoint,standard_capabilities,tests}.rs`
19+
- `distributed/crypto_lock/validation.rs` (652L) → `validation/{mod,types,validators,tests}.rs`
20+
- `toadstool/runtime/mod.rs` (651L) → `mod.rs` (189L) + `tests.rs` (463L)
21+
- `cli/configurator/core.rs` (643L) → `core/{mod,defaults,apply_validate,tests}.rs`
22+
23+
#### Production Log/Error String Evolution (8 files)
24+
- `"Songbird"``"coordination service"` in songbird_integration (transport, connection, capability_discovery)
25+
- `"BearDog"``"security/crypto service"` in beardog_integration discovery + integration/beardog
26+
- `"NestGate"``"storage service"` in integration/nestgate client
27+
- `"Squirrel"``"AI/routing service"` in biomeos agent_backend + CLI executor
28+
- `DistributedError` display: "Coordination service registration failed"
29+
30+
#### Quality
31+
- 21,853 tests (0 failures) — net +229 from new module tests
32+
- `cargo clippy --workspace --all-targets -- -D warnings` clean
33+
- Remaining `SONGBIRD_SOCKET` env var refs in tests updated to `BIOMEOS_COORDINATION_SOCKET`
934

1035
### Session S177 (Apr 4, 2026) — Capability-Based Evolution + Large File Refactoring
1136

DEBT.md

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

3-
**Date**: April 4, 2026 — S177
3+
**Date**: April 4, 2026 — S180
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.
@@ -26,6 +26,27 @@ MOS 6502 / Z80 emulator trait impls return `EmbeddedEmulatorPlaceholder` errors.
2626
Evolve when cycle-accurate CPU cores are implemented.
2727
Files: `embedded/emulator_impls.rs`, `embedded/emulators.rs`.
2828

29+
## S180 Resolved Debt (Deep Debt Evolution — Async I/O, Refactoring, String Evolution)
30+
31+
### Async I/O Fix
32+
- `distributed/universal/detection/mod.rs`: Replaced blocking `std::fs::read_dir` with
33+
`tokio::fs::read_dir` in 2 async detector functions (`detect_neuromorphic_platforms`,
34+
`detect_edge_iot_platforms`). Graceful fallback on missing `/dev`.
35+
36+
### Large File Smart Refactoring (5 files)
37+
- `server/cross_gate.rs` (660L) → `cross_gate/{mod,types,dispatcher,router,tests}.rs`
38+
- `common/infant_discovery/capabilities.rs` (658L) → `capabilities/{mod,discovered,discovery_traits,substrate,endpoint,standard_capabilities,tests}.rs`
39+
- `distributed/crypto_lock/validation.rs` (652L) → `validation/{mod,types,validators,tests}.rs`
40+
- `toadstool/runtime/mod.rs` (651L) → `mod.rs` (189L) + `tests.rs` (463L)
41+
- `cli/configurator/core.rs` (643L) → `core/{mod,defaults,apply_validate,tests}.rs`
42+
43+
### Production String Evolution (8 files)
44+
- Evolved primal-name string literals in log/error messages to capability-first:
45+
`"Songbird"``"coordination service"`, `"BearDog"``"security/crypto service"`,
46+
`"NestGate"``"storage service"`, `"Squirrel"``"AI/routing service"`
47+
- Updated `DistributedError::SongbirdRegistration` display text to `"Coordination service registration failed"`
48+
- All corresponding test assertions updated
49+
2950
## S177 Resolved Debt (Capability-Based Evolution + Refactoring)
3051

3152
### D-ENVCONFIG-PRIMAL-NAMES — RESOLVED S177

NEXT_STEPS.md

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

3-
**Updated**: April 4, 2026 -- S177 Capability-Based Evolution
4-
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-only** | **All quality gates green** | 21,624 tests (0 failures) | **~67 JSON-RPC methods** | Zero C FFI deps (ecoBin v3.0) | Zero production unwraps | IPC-first | **43/43 crates with `unsafe_code` lint policy** (23 forbid + 20 deny) | **~59 unsafe blocks** (48 in containment zones, 11 in consumer code; consumer −80%)
5-
**Latest**: S177Capability-based evolution: env_config fields renamed from primal names to capability names (`songbird_port``coordination_port`, etc.) with serde aliases. Removed deprecated socket path functions (`get_beardog_socket_path` etc.), IPC `connect_to_primal`/`resolve_primal`. Smart-refactored 5 more files >650L. All quality gates green.
3+
**Updated**: April 4, 2026 -- S180 Deep Debt Evolution
4+
**Status**: Production-grade | Rust edition **2024** (MSRV 1.85) | **AGPL-3.0-only** | **All quality gates green** | 21,853 tests (0 failures) | **~67 JSON-RPC methods** | Zero C FFI deps (ecoBin v3.0) | Zero production unwraps | IPC-first | **43/43 crates with `unsafe_code` lint policy** (23 forbid + 20 deny) | **~59 unsafe blocks** (48 in containment zones, 11 in consumer code; consumer −80%)
5+
**Latest**: S180Fixed blocking `std::fs::read_dir` in async detectors. Smart-refactored 5 more files >640L (cross_gate, infant_discovery/capabilities, crypto_lock/validation, runtime/mod, configurator/core). Evolved 8 files of primal-name string literals in production log/error messages to capability-first naming. All quality gates green.
66

77
---
88

README.md

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

3-
**Sovereign Compute Hardware** | Pure Rust | ecoBin | March 2026
3+
**Sovereign Compute Hardware** | Pure Rust | ecoBin | April 2026
44

55
---
66

@@ -42,7 +42,7 @@ Nest = Tower + NestGate <- storage
4242
| `cargo fmt --all -- --check` | 0 diffs |
4343
| `cargo clippy --workspace --all-targets -- -D warnings` | 0 warnings |
4444
| `cargo doc --workspace --no-deps` | 0 warnings |
45-
| `cargo test --workspace` | **21,624 tests, 0 failures** (S177), 220 ignored (hardware-gated) |
45+
| `cargo test --workspace` | **21,853 tests, 0 failures** (S180), 220 ignored (hardware-gated) |
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) |
4848
| `unsafe` blocks | **~59 actual** (48 in `hw-safe`/`v4l2::ioctl` containment zones, 11 in consumer/driver code); SAFETY-documented; **23 crates forbid, 20 deny** `unsafe_code` |
@@ -244,7 +244,7 @@ toadStool/
244244
| Clippy pedantic warnings | 0 (workspace-wide `clippy::pedantic` clean; `#[expect]` evolution S131+) |
245245
| Doc warnings | 0 |
246246
| Build warnings | 0 |
247-
| Workspace tests | **21,624** (S177), 0 failures |
247+
| Workspace tests | **21,853** (S180), 0 failures |
248248
| Full workspace test time | ~8m (8 threads, GPU crates have NVK resilience wrappers) |
249249
| `unsafe` blocks | **~59 actual** (48 in containment zones, 11 in consumer code); SAFETY-documented; **23 crates forbid, 20 deny** `unsafe_code` |
250250
| Production panics/unwraps | 0 blind `unwrap()`; infallible `expect()` only |
@@ -265,7 +265,7 @@ toadStool/
265265
**We are still evolving.** barraCuda (separate primal) owns all math and shaders. ToadStool focuses on hardware discovery, capability probing, and workload orchestration. All 5 spring handoffs absorbed.
266266

267267
### Active / Next
268-
- **Test coverage** -- pushing toward 90% target; 21,624 tests (S177); ~80-85% lib-only line (185K lines instrumented); remaining gap: hardware-dependent paths, specialty runtimes
268+
- **Test coverage** -- pushing toward 90% target; 21,853 tests (S180); ~80-85% lib-only line (185K lines instrumented); remaining gap: hardware-dependent paths, specialty runtimes
269269
- **DF64 / ComputeDispatch** -- transferred to barraCuda team (S93); toadStool serves hardware capabilities
270270
- **Sovereign compiler Phase 4+** -- register pressure estimation, loop software pipelining (barraCuda)
271271

@@ -305,7 +305,7 @@ See [CHANGELOG.md](CHANGELOG.md) for full session-by-session detail.
305305

306306
| ID | Description | Status |
307307
|----|-------------|--------|
308-
| D-COV | Test coverage → 90% | Active -- 21,624 tests (S177); ~80-85% lib-only line (185K instrumented); remaining gap: hardware paths |
308+
| D-COV | Test coverage → 90% | Active -- 21,853 tests (S180); ~80-85% lib-only line (185K instrumented); remaining gap: hardware paths |
309309
| D-S20-003 | ~~neuralSpring `evolved/` migration~~ | **RESOLVED** -- neuralSpring V89 completed; `evolved/` removed |
310310
| D-S18-002 | ~~cubecl transitive `dirs-sys`~~ | **RESOLVED** -- cubecl removed; dirs-sys only via wasmtime-cache (feature-gated) |
311311

@@ -349,7 +349,7 @@ See [DEBT.md](DEBT.md) for full register and evolution paths.
349349

350350
---
351351

352-
**Last Updated**: April 4, 2026 — S177. **21,624** workspace tests, 0 failures. ~80-85% lib-only line coverage (target 90%). **~67 JSON-RPC methods** (`identity.get`, `health.liveness`). AGPL-3.0-only. Zero C FFI deps (ecoBin v3.0). **~59 unsafe blocks** (48 in hw-safe/ioctl containment zones, 11 in consumer code). **43 crates** with `unsafe_code` lint policy. IPC-first JSON-RPC (Unix sockets). Capability symlinks (`compute.sock`). Neural API naming (`capability.register`/`resolve`/`find`). Rust 1.85+ (edition 2024, MSRV). **S177**: Capability-based evolution — env_config fields evolved from primal names (`songbird_port`) to capability names (`coordination_port`) with serde aliases; deprecated socket/IPC functions removed; 5 more large files smart-refactored. **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
352+
**Last Updated**: April 4, 2026 — S180. **21,853** workspace tests, 0 failures. ~80-85% lib-only line coverage (target 90%). **~67 JSON-RPC methods** (`identity.get`, `health.liveness`). AGPL-3.0-only. Zero C FFI deps (ecoBin v3.0). **~59 unsafe blocks** (48 in hw-safe/ioctl containment zones, 11 in consumer code). **43 crates** with `unsafe_code` lint policy. IPC-first JSON-RPC (Unix sockets). Capability symlinks (`compute.sock`). Neural API naming (`capability.register`/`resolve`/`find`). Rust 1.85+ (edition 2024, MSRV). **S180**: Fixed blocking async I/O in platform detectors; smart-refactored 5 more files >640L; evolved primal-name strings in production logs/errors to capability-first. **Capability-based discovery compliant** per `CAPABILITY_BASED_DISCOVERY_STANDARD.md` v1.2.
353353

354354
---
355355

crates/cli/src/executor/workload/runtime.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ pub(super) async fn register_runtime_engines(orchestrator: &RuntimeOrchestrator)
5555

5656
// Python runtime removed — pyo3 FFI violates ecoBin v3.0.
5757
// Python workloads route to Squirrel via IPC.
58-
debug!(" ℹ️ Python runtime: delegate to Squirrel via IPC");
58+
debug!(" ℹ️ Python runtime: delegate to AI/routing service via IPC");
5959

6060
// WASM runtime - Optional (has zstd C dependency)
6161
#[cfg(feature = "wasm")]

0 commit comments

Comments
 (0)