Skip to main content

wickra_verify_core/
lib.rs

1//! # wickra-verify-core
2//!
3//! Verify any backtest: given a [`Claim`] — a strategy, the candle data it ran
4//! on, and the report it is *said* to have produced — recompute the report with
5//! the pinned `wickra-backtest` engine and confirm or refute the claim field by
6//! field. A doctored `claimed_report` cannot pass, because verification
7//! recomputes rather than trusting the supplied numbers.
8//!
9//! The result is a [`Verdict`]: `matches` plus every [`Mismatch`], the engine
10//! version, and three blake3 hashes. Canonicalization is byte-for-byte identical
11//! to `wickra-proof`, so a verdict's `inputs_hash` equals the proof hash of the
12//! same inputs — a verify result and a proof are cross-checkable.
13//!
14//! [`canonicalize`]/[`hash`] are the single source of hash stability; [`verify`]
15//! and [`explain`] are the core operations; [`Verifier`] exposes the same
16//! `command_json` boundary the ten language bindings forward verbatim.
17
18mod canon;
19mod claim;
20mod compare;
21mod config;
22mod error;
23mod verdict;
24mod verify;
25
26pub use canon::{canonicalize, hash};
27pub use claim::{BacktestReport, Candle, Claim, DatasetRef, StrategySpec};
28pub use compare::compare;
29pub use config::Config;
30pub use error::{Error, Result};
31pub use verdict::{Mismatch, Verdict};
32pub use verify::{explain, verify, Verifier};
33
34/// The wickra-verify-core crate version.
35#[must_use]
36pub fn version() -> &'static str {
37    env!("CARGO_PKG_VERSION")
38}
39
40#[cfg(test)]
41mod tests;