Skip to main content

Crate sharpebench_protocol

Crate sharpebench_protocol 

Source
Expand description

The language-agnostic agent ⇄ harness protocol.

Agents are external — a container or HTTP endpoint, in any language — not Rust code. Each decision step the harness sends a MarketObservation (JSON) and the agent replies with a Decision (JSON). Keeping this surface tiny and stable is what lets any vendor compete (and is the whole adoption story).

All observations are point-in-time: close_history, fundamentals and news only ever contain information available at or before date.

Structs§

AgentTrajectory
An agent’s full captured trajectory: every (window × seed) run’s raw decisions. Serde-(de)serializable to JSON; this is the on-disk artifact a separate verifier ingests to recompute the score from raw decisions alone.
Decision
What the agent returns.
DecisionStep
One captured decision step of a single backtest run: the agent’s raw output at one point-in-time observation. This is the persisted artifact — it holds the agent’s Decision (orders, sizing, conviction, reasoning) tagged with the observation it was made against, and deliberately stores no returns, NAV, or any self-reported metric. The score is recomputed by replaying these decisions through the engine, never read from the agent’s word.
MarketObservation
What the agent sees at one decision point.
Order
A single per-instrument instruction.
PositionState
The agent’s current holding in one instrument.
RunTrajectory
One captured backtest run (a single window × seed): the ordered sequence of the agent’s raw decision steps, plus the (window, seed) coordinates needed to replay it through the identical point-in-time engine path.
SymbolSnapshot
Point-in-time data for one instrument.

Enums§

Action
Discrete action label (sizing is carried by target_weight).