Expand description
§wickra-verify-core
Verify any backtest: given a Claim — a strategy, the candle data it ran
on, and the report it is said to have produced — recompute the report with
the pinned wickra-backtest engine and confirm or refute the claim field by
field. A doctored claimed_report cannot pass, because verification
recomputes rather than trusting the supplied numbers.
The result is a Verdict: matches plus every Mismatch, the engine
version, and three blake3 hashes. Canonicalization is byte-for-byte identical
to wickra-proof, so a verdict’s inputs_hash equals the proof hash of the
same inputs — a verify result and a proof are cross-checkable.
canonicalize/hash are the single source of hash stability; verify
and explain are the core operations; Verifier exposes the same
command_json boundary the ten language bindings forward verbatim.
Structs§
- Backtest
Report - The result of a backtest run.
- Candle
- One OHLCV bar.
timeis the bar’s open time (engine-defined epoch unit; it is passed straight through to indicators that need a timestamp). - Claim
- A claim to verify: a strategy, the data it ran on, and the report it is said
to have produced.
claimed_reportis untrusted — verification recomputes the report fromstrategy+ data and compares, so a doctoredclaimed_reportcannot pass. - Config
- The comparison tolerances a
Verifieris built with. - Mismatch
- A single field where the claimed report disagrees with the recomputed one,
beyond tolerance.
fieldis a dotted/indexed path (metrics.sharpe,trades[3].pnl,trades[len]).deltaisactual - claimed, rounded to the 1e-8 display grid — human-facing only, never part of a hash. - Strategy
Spec - A complete strategy specification.
- Verdict
- The result of verifying a claim. Deterministic and self-contained: the same
(claim, data)yields a byte-identical verdict in every language, and the three hashes let a verdict be cross-checked against awickra-proofproof of the same inputs. - Verifier
- Command-JSON handle carrying the comparison tolerances. Holds no other state, but is handle-shaped so the ten language bindings share the same surface as screener/proof/terminal.
Enums§
- Dataset
Ref - Where the candle data behind a claim comes from.
- Error
- Everything that can go wrong while verifying a claim.
Functions§
- canonicalize
- Produce the canonical string form of any serializable value (a report, a
verdict, or the
(strategy, data)inputs). The value is first converted to aserde_json::Valueand then canonicalized, so the output is independent of struct field order and depends only on the data. - compare
- Compare
claimedagainstactual(both a report as a JSON value) field by field, returning every numeric disagreement (and any array-length disagreement) beyond the given tolerance, stably sorted by field path. An empty result means the claim holds. - explain
- A human-readable, deterministic one-shot summary of a verdict.
- hash
- The lowercase 64-hex blake3 of a canonical string (no prefix). Pairs with
canonicalize:hash(&canonicalize(x)?)is the stable digest ofx. - verify
- Verify a claim against candle data with the default tolerances
(
atol = 1e-9,rtol = 1e-6). Recomputes the report and compares — a doctoredclaimed_reportis refuted, an honest one is confirmed. - version
- The wickra-verify-core crate version.
Type Aliases§
- Result
- The result of a wickra-verify-core operation.