Skip to main content

Crate af_backtest

Crate af_backtest 

Source
Expand description

af-backtest — deterministic historical replay for product adapters.

This crate owns the reusable mechanics only: ordered historical ingress, state transitions, decision traces, value curves, metrics, and bounded report projection. Domain event types, accounting, execution semantics, data providers, and concrete strategies stay in product/extension crates.

Structs§

BacktestConfig
Replay limits.
BacktestDefinition
Tenant-owned deterministic replay definition.
BacktestProjection
A transport/chat-safe projection of a potentially large full report.
BacktestReport
Full replay output.
BacktestRun
Durable replay record; computation resumes from these snapshots, never a mutable definition.
BacktestSummary
Aggregate metrics for a replay.
ProjectionPolicy
Caps for projecting a report to chat or API consumers.
ReplayStep
Captured decision trace for one event.
ValuePoint
Value after one event.

Enums§

BacktestError
Failure while validating input or replaying.
BacktestRunStatus
Durable replay lifecycle.
BacktestStoreError
Failure owned by the durable replay store.

Traits§

BacktestModel
Product-supplied deterministic replay behavior.
BacktestStore
Durable persistence port for definitions, snapshots, runs and bounded reports.

Functions§

run_backtest
Execute a deterministic replay. Events with the same timestamp are allowed and preserve input order; decreasing timestamps fail closed.
run_backtest_with_control
Execute a deterministic replay while observing cancellation and deadline between input events.