Shared library for the river-data platform: sync protocol, control plane types, and data toolbox.
client— sync service HTTP client (reqwest)server— sync control plane handlers (axum, sea-orm)toolbox— RIVER lab data toolset
Rust implementations of calculation functions originally written in R. Each function is tested against the original R output using 12,500+ bulk random cases to ensure numerical equivalency.
cargo test --features toolbox # all tests (unit + golden)
cargo test --features toolbox --test toolbox_golden # golden value tests only
cargo test --features toolbox --lib # unit tests onlyRscript r_reference/generate_fixtures.RProduces tests/fixtures/golden_values.json. Deterministic output via set.seed(42). Requires R >= 4.0 and jsonlite.
Rscript r_reference/verify_integrity.R <path_to_calculation_functions.R>Proves each file in r_reference/functions/ is a byte-exact copy of the portal source.
To port an R function to Rust, add the original R code as a new file in r_reference/functions/ with source attribution, add test cases to r_reference/generate_fixtures.R, and submit a PR to @evanjt.