Skip to content

Commit 240b7df

Browse files
author
eastgate
committed
feat: lock-free concurrency, zero-sleep testing, dehydration evolution, +21 tests
Session 24 deep debt resolution: - CircuitBreaker: Mutex → AtomicU64 (fully synchronous, lock-free) - HandlerError: String → Cow<'static, str> (zero-alloc static messages) - list_capabilities: OnceLock cache (computed once) - Dehydration: real payload bytes, DAG-walking agent summaries, runtime attestation collection - Zero-sleep tests: serve_with_ready(Notify), wait_for_tcp_ready, wait_for_exit - Removed 22x discovery test serialization lock (instances already isolated) - +21 tests (handler aliases, MCP tools, manifest env, RPC errors) → 1,423 total - Archived 6 stale Dec 2025 root docs, updated CHANGELOG/README/CONTEXT/DEPLOYMENT - Fixed broken intra-doc link (cargo doc -D warnings clean) Made-with: Cursor
1 parent 5e535a0 commit 240b7df

31 files changed

+5773
-220
lines changed

CHANGELOG.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,54 @@ All notable changes to rhizoCrypt 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+
## [0.14.0-dev] - 2026-04-01 (session 24)
9+
10+
### Changed
11+
12+
#### Deep Debt: Lock-Free Concurrency, Zero-Sleep Testing, Allocation Elimination
13+
14+
**1. Lock-Free CircuitBreaker**
15+
- Replaced `tokio::sync::Mutex<Option<Instant>>` with `AtomicU64` (nanos since epoch)
16+
- `state()`, `allow_request()`, `record_failure()` now fully synchronous — zero async overhead
17+
- Uses `Ordering::Acquire/Release` for correctness without locks
18+
19+
**2. Zero-Sleep Testing (all non-chaos tests)**
20+
- `JsonRpcServer` + `UdsJsonRpcServer`: added `serve_with_ready(Arc<Notify>)` — deterministic readiness
21+
- Binary integration tests: `wait_for_tcp_ready()` + `wait_for_exit()` replace all `sleep` calls
22+
- Discovery tests: removed 22x serialization lock (`DISCOVERY_MOCK_TCP_LOCK`) — instances already isolated
23+
- Circuit breaker tests: converted to plain `#[test]` with `Duration::ZERO` — no tokio needed
24+
25+
**3. Hot-Path Allocation Elimination**
26+
- `HandlerError::InvalidParams` + `MethodNotFound`: `String``Cow<'static, str>` (zero alloc for static messages)
27+
- `list_capabilities`: `OnceLock` cache — computed once, cloned by reference
28+
29+
**4. Dehydration Pipeline Evolution**
30+
- Payload bytes: queries `InMemoryPayloadStore::total_bytes()` with vertex-count fallback
31+
- Agent summaries: walks DAG for real `AgentJoin`/`AgentLeave` events (roles, counts, timestamps)
32+
- Attestation collection: discovers `SigningClient` at runtime, requests real cryptographic attestations
33+
- Deleted orphan `dehydration_ops.rs`
34+
35+
**5. Test Coverage (+21 tests)**
36+
- Handler: health aliases, MCP tools.list/tools.call, capability aliases, RPC error propagation
37+
- Discovery manifest: env resolution, publish/unpublish roundtrip, scan, discover-by-capability
38+
39+
**6. Doc & CI Fixes**
40+
- Fixed broken `[rhizocrypt_service::ServiceError]` intra-doc link (`cargo doc -D warnings` clean)
41+
- Archived 6 stale Dec 2025 session docs from root to `archive/dec-27-2025-session-docs/`
42+
43+
### Quality Gates
44+
45+
- `cargo fmt` — clean
46+
- `cargo clippy --workspace --all-targets --all-features -- -D warnings` — 0 warnings
47+
- `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps` — clean
48+
- `cargo test --workspace --all-features`**1,423 tests passing**, 0 failures
49+
- All `.rs` files under 1000 lines
50+
- Zero unsafe, zero production unwrap/expect
51+
- Zero sleeps in non-chaos tests
52+
- SPDX headers on all 129 `.rs` files
53+
54+
---
55+
856
## [0.14.0-dev] - 2026-03-31 (session 23)
957

1058
### Added
@@ -1283,6 +1331,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
12831331

12841332
## Version History Summary
12851333

1334+
- **0.14.0-dev** (2026-04-01 s24): Lock-free CircuitBreaker, zero-sleep testing, Cow errors, OnceLock cache, dehydration evolution, +21 tests → 1,423
12861335
- **0.14.0-dev** (2026-03-31 s23): RC-01 fix — UDS transport + dual-mode TCP + `biomeos` path migration + deep debt evolution, 1,402 tests
12871336
- **0.13.0-dev** (2026-03-23 s19): MCP tools, DagBackend enum, GC sweeper, RedbDagStore wiring, 5 proptests, normalize_method, health alignment, debris cleanup, 1,412 tests
12881337
- **0.13.0-dev** (2026-03-17 s18): Sovereignty — provenance-trio-types eliminated, wire types inlined, 14-crate ecoBin deny, 6 file extractions, cross-compile CI, RUSTSEC-2026-0049 fix

CONTEXT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Three workspace crates:
6565

6666
| Metric | Value |
6767
|--------|-------|
68-
| Tests | 1,402 passing (all features) |
68+
| Tests | 1,423 passing (all features) |
6969
| Coverage | CI gate: `--fail-under-lines 90` (~94% line coverage) |
7070
| Clippy | 0 warnings (pedantic + nursery + cargo + cast lints, `missing_errors_doc = "warn"`) |
7171
| Source files | 129 `.rs`, ~45,000 lines |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
|--------|-------|
77
| Version | 0.14.0-dev |
88
| License | AGPL-3.0-or-later / ORC / CC-BY-SA 4.0 ([scyBorg Triple-Copyleft](LICENSE)) |
9-
| Tests | 1,402 passing (`--all-features`) |
9+
| Tests | 1,423 passing (`--all-features`) |
1010
| Coverage | CI gate: `--fail-under-lines 90` |
1111
| Clippy | 0 warnings (pedantic + nursery + cargo + cast lints, `unwrap_used`/`expect_used = "deny"`, `missing_errors_doc = "warn"`) |
1212
| Edition | 2024 (rust-version 1.87) |
1313
| Unsafe | `unsafe_code = "deny"` workspace-wide, `#![forbid(unsafe_code)]` in non-test, zero `unsafe` blocks |
1414
| Binary | `rhizocrypt` (UniBin, subcommands via clap) |
1515
| IPC | JSON-RPC 2.0 (HTTP + newline) + tarpc 0.37 (bincode) — dual-transport first |
1616
| Streaming | NDJSON pipeline coordination for `event.append_batch` |
17-
| Resilience | CircuitBreaker + RetryPolicy for IPC clients |
17+
| Resilience | Lock-free CircuitBreaker (atomics) + RetryPolicy for IPC clients |
1818
| Error Model | Structured `IpcErrorPhase` + `DispatchOutcome` (protocol vs application) |
1919
| Discovery | Capability-based + manifest-based (`$XDG_RUNTIME_DIR/biomeos/{primal}.json`) |
2020
| Chaos | `ChaosEngine` framework with 7 fault classes |

0 commit comments

Comments
 (0)