Skip to main content

wickra_strategy_ci_core/
lib.rs

1//! Data-driven core of Wickra Strategy-CI.
2//!
3//! A [`StrategyTest`] carries an opaque `StrategySpec` sub-JSON that is forwarded
4//! verbatim to the [`wickra-backtest`](https://github.com/wickra-lib/wickra-backtest)
5//! engine. The resulting `BacktestReport` is golden-pinned and asserted against
6//! per-field [`Tolerance`]s, checked for invariant [`Property`]s, and fuzzed with
7//! seeded data [`Perturbation`]s. The [`Session`] `command_json` boundary is the
8//! single JSON entry point every language binding drives, so results are
9//! byte-identical across languages and between the parallel and sequential paths.
10
11#![cfg_attr(docsrs, feature(doc_cfg))]
12
13mod config;
14mod error;
15mod fuzz;
16mod model;
17mod property;
18mod runner;
19mod session;
20mod tolerance;
21
22pub use config::{Config, VERSION};
23pub use error::{Error, Result};
24pub use model::{
25    flatten_report, round8, DiffKind, FieldDiff, FuzzFailure, FuzzSpec, Perturbation, Property,
26    PropertyResult, ReportJson, StrategyJson, StrategyTest, SuiteResult, TestResult, Tolerance,
27};
28pub use property::{check, check_all};
29pub use runner::{bless, run_suite, run_test};
30pub use session::Session;
31pub use tolerance::diff_reports;
32
33/// The OHLCV candle type, re-exported from the backtest engine so tests, data and
34/// bindings all speak the exact same JSON.
35pub use wickra_backtest_core::Candle;
36
37#[cfg(test)]
38mod tests;