The project is a Rust workspace with three member crates:
The statistical engine implementing econometric decomposition methods for pay-equity analysis. Operates on Polars DataFrames with linear algebra via Nalgebra.
- Purpose: Decompose mean wage gaps (or other outcome differentials) between two groups into an explained part (differences in observable characteristics) and an unexplained part (differences in the returns to those characteristics).
- Decomposition modules:
decomposition.rs: Standard Oaxaca-Blinder (two-fold and three-fold).quantile_decomposition.rs: RIF-Regression quantile decomposition (Firpo-Fortin-Lemieux).jmp.rs: Juhn-Murphy-Pierce decomposition.dfl.rs: DiNardo-Fortin-Lemieux reweighting.akm.rs: Abowd-Kramarz-Margolis high-dimensional fixed effects.heckman.rs: Heckman two-step selection correction.matching/: Propensity-score matching (logistic model, distance metrics, matching engine).
- Math utilities (
math/): OLS, quantile regression, KDE, RIF, probit, logit, diagnostics, coefficient normalization. - Entry points:
OaxacaBuilderandQuantileDecompositionBuilder(builder pattern). - Interfaces:
- CLI:
src/main.rsexposes theoaxaca-clibinary. - Python:
python.rsholds PyO3 bindings behind apythonfeature flag. The flag is currently disabled (commented out inCargo.toml); the module does not compile in the default build.
- CLI:
Wraps oaxaca_blinder with the analysis layer the Meridian app consumes.
- Purpose: Budget-constrained wage-adjustment optimization, adjustment verification, efficient frontier calculation, and defensibility scoring.
- Key modules:
analysis.rs: decomposition driver, budget optimizer, and efficient-frontier calculation.defensibility.rs: per-adjustment defensibility scoring against the reference-group standard.types.rs: request/response structs shared across the WASM and MCP surfaces.access.rs: partner offline-access codes, gated behind the off-by-defaultpartner-accessfeature (not part of the default or standard WASM build).
- WASM target: the
wasmfeature exposesdecompose,optimize,verify_adjustments,calculate_efficient_frontier, andcheck_defensibilityto the browser viawasm-bindgen.
A JSON-RPC server (stdio, or SSE/HTTP via Axum) exposing the engine functions as MCP tools:
decompose, optimize, verify_adjustments, calculate_efficient_frontier,
check_defensibility. Configurable via CLI args or env vars (PORT, MCP_TRANSPORT, MCP_API_KEY).
- Input: Data is ingested as Polars DataFrames (from CSV bytes at the WASM/MCP boundary).
- Decomposition (
oaxaca_blinder): linear algebra via Nalgebra; bootstrap replications parallelized with Rayon. - Optimization (
pay-equity-engine): budget-constrained wage adjustments. Fair-wage standards are solved with direct linear algebra (OLS/SVD via Nalgebra); convex optimization is available via Clarabel. - Output: results are returned as Rust structs (CLI / MCP), as
JsValueacross the WASM boundary, or printed to stdout (CLI).
- Language: Rust (Edition 2021)
- Data Processing:
polars(lazy evaluation, high performance) - Math / Stats:
nalgebra: linear algebra (DMatrix/DVector).statrs: statistical distributions.clarabel: convex optimization solver.
- Parallelism:
rayon(bootstrap iterations). - CLI:
clap. - WASM:
wasm-bindgen(+serde-wasm-bindgen), behind thewasmfeature. - MCP transport:
axum(SSE/HTTP) or stdio.
Monetary values are represented with fixed-point precision, never
Float64, per the comp-audit-suite rule (seeCLAUDE.md).