Skip to content

Commit 67db337

Browse files
author
BiomeOS Developer
committed
V121: deep debt + ecosystem absorption — smart refactoring, lint hardening, docs/handoff sync
Structural: biomeos/mod.rs 631→232 lines (extracted storage, compute, registration, health, routing, client_tests submodules), stats/agreement.rs → directory (coefficient, error_metrics, efficiency, willmott, hit_rate). Zero public API change. Ecosystem absorption: normalize_method() for legacy RPC prefixes (barraCuda/wetSpring), 5-tier socket discovery with socket-registry.json (biomeOS V266), NdjsonSink for machine-readable validation (wetSpring V132), IpcError::is_recoverable() (wetSpring/ healthSpring), provenance trio run_lifecycle() (primalSpring), MCP capability_registry.toml (airSpring V0.10). Lint hardening: workspace deny unwrap_used/expect_used, all test modules annotated, #[cfg_attr(not(test), expect(dead_code))] for feature-conditional fields, MSRV 1.87. Hardcoding→capability: /tmp→temp_dir(), server timeouts env-driven, is_enabled() accepts "biomeos"/"true"/"1", stale IPC doc fixed. Provenance: missing DOI added to benchmark_et0_methods.json (FAO-56 10.4060/x0490e). Docs: README/CHANGELOG/CONTEXT/CONTRIBUTING/CONTROL_RUN_LOG updated to V121, specs headers refreshed, baseCamp/experiments READMEs synced, wateringHole handoffs created (V121 ecosystem + barraCuda/toadStool absorption). Quality: 691 lib tests, 0 clippy warnings, 0 doc warnings, 0 unsafe, 0 unwrap/expect in production, 0 TODOs, ≥92% coverage. Made-with: Cursor
1 parent aea1de5 commit 67db337

49 files changed

Lines changed: 1801 additions & 999 deletions

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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,59 @@ All notable changes to groundSpring follow [Keep a Changelog](https://keepachang
44

55
## [Unreleased]
66

7+
### V121 Deep Debt + Ecosystem Absorption (Mar 23, 2026)
8+
9+
#### Smart Refactoring
10+
- **`biomeos/mod.rs` refactored**: 631 → 232 lines — extracted `storage.rs`,
11+
`compute.rs`, `registration.rs`, `health.rs`, `routing.rs`, `client_tests.rs`
12+
into focused submodules. Zero public API change
13+
- **`stats/agreement.rs` refactored**: 534-line monolith → `stats/agreement/`
14+
directory with `coefficient.rs`, `error_metrics.rs`, `efficiency.rs`,
15+
`willmott.rs`, `hit_rate.rs`, `mod.rs`. Zero public API change
16+
17+
#### Ecosystem Absorption
18+
- **`normalize_method()`**: Strips legacy `groundspring.`/`barracuda.` prefixes
19+
from RPC method names before dispatch. `capabilities.list` plural alias added.
20+
Absorbed from barraCuda v0.3.7 / wetSpring V132
21+
- **5-tier socket discovery**: `primal_names::discover_socket()` now supports
22+
env var → XDG family-qualified → XDG flat → socket-registry.json → temp_dir.
23+
Registry uses zero-dependency string parsing. Absorbed from biomeOS V266
24+
- **`NdjsonSink<W>`**: Machine-readable NDJSON validation output — one JSON
25+
object per line for CI/pipeline consumption. Absorbed from wetSpring V132
26+
- **`IpcError::is_recoverable()`**: Connect/Transport → recoverable,
27+
Remote/Discovery → permanent. Absorbed from wetSpring V132 / healthSpring V41
28+
- **Provenance trio lifecycle**: `store_result()` + `run_lifecycle()`
29+
start→store→commit→attribute session pattern. Absorbed from primalSpring V0.3.0
30+
- **MCP capability registry**: `capability_registry.toml` with 16 tool
31+
definitions for Squirrel integration. Absorbed from airSpring V0.10
32+
33+
#### Lint & Safety Hardening
34+
- **Workspace lints tightened**: `clippy::unwrap_used` and `clippy::expect_used`
35+
now denied at workspace level. All test modules and validation binaries
36+
annotated with `#[expect]`
37+
- **`#[allow(dead_code)]``#[cfg_attr(not(test), expect(dead_code, ...))]`**
38+
in `biomeos/protocol.rs` for correct feature-conditional handling
39+
- **MSRV bumped**: 1.85 → 1.87 (aligns with wgpu 29 MSRV)
40+
41+
#### Hardcoding → Capability-Based
42+
- **`/tmp``std::env::temp_dir()`** in socket discovery fallback
43+
- **Server timeouts** now env-driven via shared `connect_timeout()`/`read_timeout()`
44+
- **`is_enabled()`** accepts `"biomeos"`, `"true"`, `"1"` (no longer hardcoded to single role name)
45+
- **Stale doc fixed**: `GROUNDSPRING_IPC_SOCKET``GROUNDSPRING_SOCKET` in ipc.rs
46+
47+
#### Provenance
48+
- **Missing DOI added**: `benchmark_et0_methods.json``10.4060/x0490e` (FAO-56)
49+
50+
#### Quality Gates
51+
- `cargo fmt --all -- --check`: PASS
52+
- `cargo clippy --workspace --all-targets -- -D warnings -W clippy::pedantic -W clippy::nursery`: 0 warnings
53+
- `cargo doc --no-deps`: PASS (0 warnings)
54+
- `cargo test -p groundspring --lib`: 691 tests, 0 failures
55+
- Library line coverage: ≥92%
56+
- 0 TODOs/FIXMEs in library code
57+
- 0 unsafe code in lib
58+
- 0 unwrap/expect in production code (workspace-denied)
59+
760
### V120 Deep Audit Execution — Refactoring + Safety + CI Hardening (Mar 23, 2026)
861

962
#### Structural Refactoring

CONTEXT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ for noise characterization and uncertainty quantification.
2828
- **License:** AGPL-3.0-or-later
2929
- **Tests:** 990+ Rust tests + 287 Python provenance tests
3030
- **Coverage:** ≥92% library line coverage (`cargo llvm-cov --workspace --lib`)
31-
- **MSRV:** Rust 1.85 (2024 edition)
31+
- **MSRV:** Rust 1.87 (2024 edition)
3232
- **Crate count:** 3 workspace crates
3333
- **Validation checks:** 395/395 PASS across 34 binaries
3434
- **barraCuda delegations:** 110 active (67 CPU + 43 GPU)

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ control/ Python Phase 0 experiments (29 experiments across 9 domains
3535
crates/
3636
groundspring/ Rust library (40 modules)
3737
src/stats/ RMSE, MBE, R², IA, hit rate, Pearson/Spearman, covariance,
38-
norm_cdf/ppf, chi2_statistic, mean, std, percentile (3 submodules)
38+
norm_cdf/ppf, chi2_statistic, mean, std, percentile
39+
agreement/ RMSE, MAE, MBE, NSE, R², IA, WIA, hit rate (6 submodules)
40+
metrics.rs Mean, std_dev, percentile, Welford online
41+
correlation.rs Pearson, Spearman, covariance (+ GPU fused paths)
3942
src/decompose.rs Bias-variance decomposition, noise floor
4043
src/fao56/ FAO-56 Penman-Monteith equation chain (modular: daily, hargreaves, crop_soil, et0_methods, pipeline)
4144
src/prng.rs Xorshift64 PRNG, Box-Muller normal sampling, binomial

CONTROL_RUN_LOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ See [CONTROL_EXPERIMENT_STATUS.md](CONTROL_EXPERIMENT_STATUS.md) for the current
55

66
> **Note**: V75+ runs are documented in CHANGELOG.md and per-version handoffs
77
> in `wateringHole/handoffs/`. This log covers the structured run format used
8-
> through V74. Current status: V119, 990+ tests (default), 395/395 checks, 110 delegations (67 CPU + 43 GPU).
8+
> through V74. Current status: V121, 691+ lib tests (default), 395/395 checks, 110 delegations (67 CPU + 43 GPU).
99
1010
## Run Log
1111

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ members = [
1111

1212
[workspace.package]
1313
edition = "2024"
14-
rust-version = "1.85"
14+
rust-version = "1.87"
1515
license = "AGPL-3.0-or-later"
1616
repository = "https://github.com/ecoPrimals/groundSpring"
1717

@@ -26,6 +26,8 @@ missing_docs = "deny"
2626
pedantic = { level = "warn", priority = -1 }
2727
nursery = { level = "warn", priority = -1 }
2828
module_name_repetitions = "allow"
29+
unwrap_used = "deny"
30+
expect_used = "deny"
2931

3032
[profile.release]
3133
lto = true

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
[![Rust](https://img.shields.io/badge/rust-2024_edition-orange.svg)](https://www.rust-lang.org/)
77
[![ecoBin](https://img.shields.io/badge/ecoBin-compliant-green.svg)](https://github.com/ecoPrimals/wateringHole/blob/main/ECOBIN_ARCHITECTURE_STANDARD.md)
88

9-
**Date**: March 23, 2026 | **License**: AGPL-3.0-or-later
10-
**Status**: V120 — 40 modules, 35 experiments, 990+ Rust tests + 287 Python provenance tests, 395/395 validation checks (340 core + 55 NUCLEUS) + 140 metalForge checks, 110 active barraCuda delegations (67 CPU + 43 GPU) — synced against barraCuda v0.3.5, toadStool S158+, coralReef Iteration 55+. Three-tier parity proven: 29/29 validation binaries PASS at all three tiers. `cargo deny check` PASS, `cargo clippy --all-features` clean, `cargo check --all-features` compiles. ≥92% library line coverage (`cargo llvm-cov --workspace --lib`). **V120**: Deep audit execution — `dispatch.rs` refactored into 4-submodule `dispatch/` (defaults, extract, lifecycle, measurement), `ValidationHarness` expanded (`check_relative`, `check_abs_or_rel`), `#![forbid(unsafe_code)]` on all 50 binary entry points, `GpuDriverProfile` → `DeviceCapabilities` migration, clippy `--all-features` clean (unfulfilled lint expectations fixed), cast helper `cfg_attr` hardened for test/feature interaction, release-mode CI validation (7 binaries under LTO), `capability_call_typed` added to biomeOS module. **V119**: Deep evolution audit + cross-ecosystem absorption — `publish = false` on all crates, MSRV 1.85, provenance registry completeness test (29 benchmarks verified at compile time), cast module expanded (airSpring parity: 7 new helpers), IPC test isolation (atomic socket counter), 30+ new tests. **V118**: RPC expansion (16 capabilities), 16 proptest invariants, PRNG DefaultRng production, spectral_recon GPU GEMM, 110 delegations, provenance hardening, CI Python 90%. **V117**: All-features compilation, cargo deny, PRNG feature gate. **V116**: Typed error evolution. **V115**: API evolution, CI hardening, ecoBin compliance.
9+
**Date**: March 23, 2026 | **License**: AGPL-3.0-or-later | **MSRV**: Rust 1.87 (2024 edition)
10+
**Status**: V121 — 40 modules, 35 experiments, 691+ lib tests + 287 Python provenance tests, 395/395 validation checks (340 core + 55 NUCLEUS) + 140 metalForge checks, 110 active barraCuda delegations (67 CPU + 43 GPU) — synced against barraCuda v0.3.7, toadStool S158+, coralReef Iteration 55+. Three-tier parity proven: 29/29 validation binaries PASS at all three tiers. `cargo deny check` PASS, `cargo clippy --all-features` clean, `cargo check --all-features` compiles. ≥92% library line coverage (`cargo llvm-cov --workspace --lib`). **V121**: Deep debt + ecosystem absorption — `biomeos/mod.rs` refactored 631→232 lines (extracted storage, compute, registration, health, routing submodules), `stats/agreement.rs` refactored into directory (coefficient, error_metrics, efficiency, willmott, hit_rate), `normalize_method()` for legacy RPC prefixes, 5-tier socket discovery with `socket-registry.json`, `NdjsonSink` for machine-readable validation output, workspace lints deny `unwrap_used`/`expect_used`, `IpcError::is_recoverable()`, provenance trio `run_lifecycle()`, MCP `capability_registry.toml`, MSRV 1.87, hardcoding→capability-based patterns (temp_dir, env-driven server timeouts, generalized `is_enabled()`). **V120**: Deep audit execution — `dispatch/` module, `ValidationHarness` expanded, `#![forbid(unsafe_code)]` on 50 binaries, `DeviceCapabilities` migration, release-mode CI. **V119**: Cross-ecosystem absorption — MSRV 1.85, provenance registry, cast module. **V118**: RPC expansion (16 capabilities), 110 delegations. **V117–V115**: All-features compilation, typed errors, ecoBin compliance.
1111

1212
**The gap between what models predict and what instruments measure.**
1313

capability_registry.toml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# SPDX-License-Identifier: AGPL-3.0-or-later
2+
# groundSpring capability registry for MCP tool discovery (Squirrel integration).
3+
#
4+
# Absorbed from airSpring V0.10 / primalSpring V0.3.0 / loamSpine V0.9.9
5+
# MCP tool manifest pattern. Squirrel uses `tools.list` / `tools.call`
6+
# to discover and invoke these capabilities at runtime.
7+
8+
[primal]
9+
name = "groundspring"
10+
domain = "measurement"
11+
description = "Measurement noise characterization and validation"
12+
version = "0.1.0"
13+
license = "AGPL-3.0-or-later"
14+
15+
[[tools]]
16+
name = "measurement.noise_decomposition"
17+
description = "Bias-variance error decomposition (RMSE, MBE, R², IA)"
18+
parameters = ["observed: f64[]", "modeled: f64[]"]
19+
20+
[[tools]]
21+
name = "measurement.anderson_validation"
22+
description = "Anderson localization Lyapunov exponent validation"
23+
parameters = ["disorder: f64", "n_sites: u32", "precision: string"]
24+
25+
[[tools]]
26+
name = "measurement.bootstrap"
27+
description = "Bootstrap confidence intervals (mean, median, std)"
28+
parameters = ["data: f64[]", "n_replicates: u32", "statistic: string?", "confidence: f64?", "seed: u64?"]
29+
30+
[[tools]]
31+
name = "measurement.rarefaction"
32+
description = "Multinomial rarefaction for sequencing noise analysis"
33+
parameters = ["counts: u64[]", "depths: u64[]"]
34+
35+
[[tools]]
36+
name = "measurement.drift"
37+
description = "Drift vs selection in finite populations (Wright-Fisher, Kimura)"
38+
parameters = ["pop_size: u32", "selection: f64", "n_trials: u32"]
39+
40+
[[tools]]
41+
name = "measurement.rare_biosphere"
42+
description = "Rare biosphere detection (Chao1, detection power)"
43+
parameters = ["counts: u64[]"]
44+
45+
[[tools]]
46+
name = "measurement.gillespie"
47+
description = "Stochastic chemical kinetics (Gillespie SSA)"
48+
parameters = ["synthesis_rates: f64[]", "degradation_rate: f64", "n_trajectories: u32", "t_max: f64"]
49+
50+
[[tools]]
51+
name = "measurement.bistable"
52+
description = "Bistable phenotypic switching (c-di-GMP circuit)"
53+
parameters = ["initial_cdg: f64", "n_steps: u32"]
54+
55+
[[tools]]
56+
name = "measurement.quasispecies"
57+
description = "Eigen quasispecies error threshold estimation"
58+
parameters = ["sigma: f64", "genome_length: u32", "mu: f64"]
59+
60+
[[tools]]
61+
name = "measurement.band_edge"
62+
description = "Band structure of periodic tight-binding chains"
63+
parameters = ["potential: f64[]", "hopping: f64", "n_points: u32"]
64+
65+
[[tools]]
66+
name = "measurement.parity_check"
67+
description = "Cross-substrate parity validation (CPU vs GPU)"
68+
parameters = ["cpu_values: f64[]", "gpu_values: f64[]", "tolerance: f64"]
69+
70+
[[tools]]
71+
name = "measurement.et0_propagation"
72+
description = "FAO-56 Penman-Monteith ET₀ uncertainty propagation"
73+
parameters = ["params: json"]
74+
75+
[[tools]]
76+
name = "measurement.freeze_out"
77+
description = "Freeze-out curve chi-squared fitting (2D grid search)"
78+
parameters = ["temperatures: f64[]", "yields: f64[]"]
79+
80+
[[tools]]
81+
name = "measurement.regime_classification"
82+
description = "ESN-based regime classification"
83+
parameters = ["features: f64[][]", "params: json?"]
84+
85+
[[tools]]
86+
name = "measurement.spectral_features"
87+
description = "Spectral function reconstruction (Tikhonov regularization)"
88+
parameters = ["kernel: f64[][]", "spectrum: f64[]", "params: json?"]
89+
90+
[[tools]]
91+
name = "measurement.uncertainty_budget"
92+
description = "Multi-source uncertainty budget estimation"
93+
parameters = ["observed: f64[]", "modeled: f64[]", "params: json?"]

control/et0_methods/benchmark_et0_methods.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"notes": "Deterministic comparison of 5 ET\u2080 methods. PM reference 3.88 from FAO-56 Example 18. Hamon underestimates in humid climates (by design \u2014 minimal inputs).",
1313
"real_data_accession": "N/A (analytical FAO-56 Example 18)"
1414
},
15+
"_doi": "10.4060/x0490e",
1516
"_description": "5-method ET\u2080 cross-validation: PM, Hargreaves, Makkink, Turc, Hamon",
1617
"_groundspring_question": "Do simplified ET\u2080 methods (fewer inputs) agree with the full Penman-Monteith equation chain?",
1718
"_references": [

crates/groundspring-validate/src/validate_rawr.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
// Copyright (C) 2026 ecoPrimals / Squirrel Team
33
#![forbid(unsafe_code)]
4+
#![expect(
5+
clippy::expect_used,
6+
reason = "validation binaries use expect for compile-time benchmark JSON; missing data is a programmer error"
7+
)]
48

59
//! Validation binary for Experiment 007: RAWR Resampling.
610
//!

crates/groundspring-validate/src/validate_resampling_conv.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
// Copyright (C) 2026 ecoPrimals / Squirrel Team
33
#![forbid(unsafe_code)]
4+
#![expect(
5+
clippy::expect_used,
6+
reason = "validation binaries use expect for compile-time benchmark JSON; missing data is a programmer error"
7+
)]
48

59
//! Validation binary for Experiment 013: Resampling Convergence.
610
//!

0 commit comments

Comments
 (0)