Module reducer
Expand description
Pure state reducer for event-sourced portfolio state (JOURNAL_SPEC §9).
reduce applies a single EngineEvent to a PortfolioState.
state_hash produces a deterministic blake3 digest of the state.
Enums§
- Reduce
Error - Recoverable errors produced by the reducer.
Functions§
- checkpoint_
state_ hash - Public wrapper for callers that only need the hash (e.g. replay
verification). Serializes
PortfolioStateonce toValue. - clear_
retiring_ order_ target - Remove
order_idfrom all retiring target sets and direct-retiring set. - create_
checkpoint - Create a
Checkpointfrom the current portfolio state. - lookup_
order_ attribution - Resolve correlation/strategy attribution for an order lifecycle event.
- lookup_
order_ intent - Resolve originating
ClientIntentIdfor an order lifecycle event. - reduce
- Apply a single event to the portfolio state.
- severity
- Severity ordering for risk stop states. Higher = more severe.
- state_
hash - Produce a deterministic hash of the portfolio state.