v0.1.0 on 16th of March, 2026
- Add CI pipeline mirroring Praxis: Ruff, Mypy strict, pytest, CodeQL workflows
- Add
pytest>=8.0andmypy>=1.10as dev dependencies - Add strict Ruff linting and Mypy configuration in
pyproject.toml - Add
.github/CODEOWNERSwith@zero-bang - Add
nexus/package with empty__init__.py - Add
test_placeholder.pywithimport nexussmoke test - Update project metadata to
vaquum-nexus - Remove template
tests/run.py
v0.2.0 on 17th of March, 2026
- Add module structure for all RFC components:
core/domain/,core/validator/,core/capital_controller/,infrastructure/,infrastructure/praxis_connector/,strategy/runner/,reconciler/,trail/ - Add
structlog>=24.0andorjson>=3.10as runtime dependencies - Add
observability.pywithconfigure_logging,bind_context,clear_context,get_logger - Add
instance_config.pywith frozenInstanceConfigdataclass (identity + capital ceiling) - Add
test_observability.pywith 10 tests covering JSON output, context binding, level filtering, and stdlib integration - Add
test_instance_config.pywith 7 tests covering creation, immutability, and validation - Add
nexus-journals/to.gitignore - Wire
nexus/__init__.pypublic API exports
v0.3.0 on 17th of March, 2026
- Add
capital_state.pywith mutableCapitalStatedataclass and derivedavailableproperty - Add
enums.pywithOperationalMode,OrderSide,BreachLevel - Add
instance_state.pycomposing all state withfrom_configfactory - Add
operational_mode.pywithModeStateandStrategyModeState(composesModeState) - Add
position.pywith mutablePositiondataclass (trade_id, strategy_id, symbol, side, size, entry_price, unrealized_pnl, pending_exit) - Add
risk_state.pywithRiskStateandStrategyRiskState(instance-level losses derived from per-strategy state) - Add
nexus/core/domain/__init__.pyre-exports - Add 34 tests covering enums, position, capital state, risk state, operational mode, and instance state composition
v0.4.0 on 18th of March, 2026
- Add
msgpack>=1.0as runtime dependency - Add
wal_entry.pywithWALEntryTypeenum (SNAPSHOT, STATE_MUTATION, STRATEGY_EVENT) and frozenWALEntrydataclass - Add
wal_codec.pywith explicit per-typeserialize_state/deserialize_statefor InstanceState via msgpack, codec version embedding - Add
wal.pywithWriteAheadLog— append-only binary log with 8-byte magic header, per-record CRC32 integrity, length-prefixed msgpack records, fsync durability - Add
snapshot.pywith atomicsave_snapshot(tmp+rename+fsync, WAL truncation) andload_snapshot - Add
state_store.pywithStateStorefacade — managessnapshots/andwal/subdirectories,checkpoint,append_mutation,recovervia snapshot + WAL replay - Add
docs/TechnicalDebt.mdwith TD-001 (codec version-dispatched deserialization) - Add mypy override for msgpack missing stubs
- Add 64 tests covering WAL entries, codec round-trip, Decimal precision, codec versioning, WAL append/read/truncate, magic header validation, CRC32 corruption detection, snapshot save/load, state store checkpoint/recover cycles
v0.5.0 on 19th of March, 2026
- Add
strategy_event.pywith frozenStrategyEventdataclass (strategy_id, event_type, realized_pnl, timestamp) - Add
serialize_event/deserialize_eventtowal_codec.pywith versioned msgpack format, Decimal-as-string precision - Add
StateStore.append_event()for writingSTRATEGY_EVENTWAL entries alongsideSTATE_MUTATIONentries - Add
loss_derivation.pywithderive_rolling_losses()pure function — scans strategy events by 24h/7d/30d windows, sums negative realized P&L per strategy - Enhance
StateStore.recover()with two-pass recovery: (1) snapshot + STATE_MUTATION replay, (2) STRATEGY_EVENT scan to re-derive and overwrite rolling loss counters - Add 44 tests covering strategy event construction/validation, event codec round-trip, loss derivation window boundaries, and enhanced recovery with checkpoint boundary handling
v0.6.0 on 19th of March, 2026
- Add
reservation.pywith frozenReservationdataclass (reservation_id, strategy_id, notional, estimated_fees, created_at, expires_at) andReservationResultoutcome type - Add
capital_controller.pywith thread-safeCapitalControllerguardingCapitalStatebehindthreading.Lock - Add
check_and_reserve()with 4 ordered atomic checks: per-trade allocation, strategy budget, available capital, total utilization - Add
release_reservation()returning locked capital to the available pool - Add constants
MAX_ALLOCATION_PER_TRADE_PCT(0.15) andMAX_CAPITAL_UTILIZATION_PCT(0.80) - Add 39 tests covering reservation validation, all check failure paths, release lifecycle, and 10-thread concurrency contention
v0.7.0 on 20th of March, 2026
- Add
tracked_order.pywithOrderLifecycleStateenum (IN_FLIGHT, WORKING) and frozenTrackedOrderdataclass - Add
CapitalController.send_order()to convert reservation into in-flight order - Add
CapitalController.order_ack()to transition in-flight → working - Add
CapitalController.order_reject()to release in-flight order capital - Add
CapitalController.order_fill()to handle partial/full fills with proportional fee allocation - Add
CapitalController.order_cancel()to release working order remaining capital - Add 45 tests covering TrackedOrder validation, all lifecycle transitions, and concurrency (281 total)
v0.8.0 on 20th of March, 2026
- Add warning log on reservation TTL expiry with reservation_id, strategy_id, total, held duration
- Add 2 tests for expiry logging (288 total)
v0.9.0 on 21st of March, 2026
- Add instance-level drawdown state fields to
RiskState: starting capital, cumulative realized/unrealized P&L, equity/HWMs, current drawdowns, and max drawdown metrics - Add deterministic recompute and update triggers for drawdown metrics via
recompute_drawdown_metrics,update_cumulative_realized_pnl, andupdate_unrealized_pnl - Extend WAL risk-state codec to persist and recover all drawdown metrics with backward-compatible defaults for older payloads
- Expose drawdown views for validator and diagnostics consumers via
to_risk_check_metrics()andto_drawdown_diagnostics() - Add comprehensive drawdown tests for formula correctness, monotonic HWM/max drawdown behavior, and codec round-trip coverage (304 total)
v0.10.0 on 21st of March, 2026
- Add
CapitalState.per_strategy_deployedwith finite non-negative validation for per-strategy deployment accounting - Add
InstanceConfig.capital_pctwith allocation validation ((0,100]per strategy, total<= 100) - Add
CapitalController.compute_strategy_budget()to derive budget fromcapital_poolandcapital_pct, with optional realized P&L auto-compounding - Refactor
check_and_reserve()to enforce strategy budget from controller-owned deployed state instead of caller-providedstrategy_deployed - Add lifecycle deployed accounting updates across reservation expiry/release and order reject/cancel paths
- Extend WAL/state recovery to persist and restore
per_strategy_deployedwith backward-compatible defaults for older payloads - Add comprehensive per-strategy isolation and accounting invariant tests (326 total)
v0.11.0 on 24th of March, 2026
- Add validator pipeline contracts for 3.1 with canonical six-stage ordering (
INTAKE -> RISK -> PRICE -> CAPITAL -> HEALTH -> PLATFORM_LIMITS) - Add ordered pipeline executor with strict short-circuit denial semantics and stage/result consistency validation
- Add RFC stage-1 intake hooks and checks (
MAX_ORDER_RATE,DUPLICATE_ORDER_WINDOW_MS, reference-integrity, spot direction, action/size guards) - Add risk-stage adapter mapping
RiskState.to_risk_check_metrics()outputs to validator deny decisions - Add price-stage checks with stable reason codes and consequence routing metadata for strategy owner vs platform ops audiences
- Add capital-stage adapter integrating
CapitalController.check_and_reserve(...)into validator decision contracts with reservation passthrough - Add health-stage telemetry policy evaluation contracts (warn/breach/halt over latency, consecutive failures, failure rate, rate-limit headroom, clock drift)
- Add stage-6 platform-limits contracts for absolute operator limits (
max_order_notional,max_order_rate,max_position,max_daily_loss,max_capital_utilization) - Add safety-action bypass for
EXIT/ABORT/CANCELacrossCAPITAL,HEALTH, andPLATFORM_LIMITS - Add deterministic denial coverage tests proving identical inputs/snapshots produce stable
failed_stage,reason_code, and message outputs
v0.12.0 on 24th of March, 2026
- Add
InstanceConfig.max_order_rateas optional operator config with strict validation (reject bool/non-int/non-positive values) - Update default intake hook wiring to source
MAX_ORDER_RATEfromInstanceConfig, while preserving explicit hook override precedence - Add duplicate-window key regression coverage to lock idempotency semantics on (
strategy_id,command_id) rather than order-shape ambiguity - Add temporal intake checks coverage for rate-window recovery and duplicate-window replay expiry behavior
- Add explicit duplicate-hook non-ENTER bypass coverage and message-stability assertions for core intake deny paths
- Expand validator intake test coverage and raise full-suite baseline to 470 passing tests
v0.13.0 on 24th of March, 2026
- Add
MODIFYedit-baseline fieldcurrent_order_notionaltoValidationRequestContextwith strict finite/non-negative validation - Add capital-stage delta semantics for
MODIFY: whencurrent_order_notionalis provided, reserve only positive deltas and skip reservation for no-op/decrease edits; otherwise reserve fullorder_notional - Add strict lifecycle gate for
MODIFYin intake hooks: requiremodifiable_command_ids, deny when unavailable, and validate command membership against modifiable set - Add capital-stage tests for
MODIFYincrease/decrease/no-op reservation behavior - Add pipeline-executor tests for
MODIFYincrease/decrease/no-op flows and deterministic deny stage/reason/message behavior - Expand validator test baseline to 486 passing tests
v0.14.0 on 24th of March, 2026
- Add RFC 3.4 price-validation config fields to
InstanceConfig:book_staleness_max_seconds,max_spread_bps,price_deviation_max_bps,reference_price_source - Add strict validation for 3.4 config fields: positive staleness seconds, finite non-negative bps thresholds, allowed
reference_price_source, and deviation-source requirement - Add
build_price_stage_limits_from_config(...)to mapbook_staleness_max_secondstomax_staleness_msand wire spread/deviation/source limits into Stage 3 - Add reference-source identity to price contracts via
PriceCheckSnapshot.reference_price_sourceandPriceStageLimits.reference_price_sourcewith non-empty validation - Fix deviation-stage behavior to deny deterministically when reference source is missing or mismatched (
PRICE_SYSTEM_DATA_UNAVAILABLE/PRICE_SNAPSHOT_INVALID) - Add and expand tests for 3.4 config validation, source-aware deviation paths, consequence routing (stale => platform-critical, spread/deviation => strategy-warning), and full-suite stability (512 passing tests)
v0.15.0 on 25th of March, 2026
- Add
stp_mode.pywithSTPModeenum (CANCEL_MAKER, CANCEL_TAKER, CANCEL_BOTH) for self-trade prevention - Add
stp_modefield toInstanceConfigwith defaultCANCEL_TAKERand validation - Add
trade_command_type.pywithTradeCommandTypeenum (NEW_ORDER, AMEND_ORDER, CANCEL_ORDER) - Add
trade_command.pywith frozenTradeCommanddataclass and command-type-specific validation - Add
translate.pywithtranslate_to_trade_command()mapping ValidationAction to TradeCommand - Add
outbound_connector.pywithOutboundConnectorprotocol for Trading sub-system dispatch - Enforce
translate_to_trade_commandguards for allowed decision and non-emptycommand_id - Enforce
TradeCommandrejection ofside/sizeforAMEND_ORDER/CANCEL_ORDERcommand types - Enforce robust
expires_atcomputation in tests usingtimedeltainstead ofminutereplacement - Add 45 tests covering STPMode, TradeCommandType, TradeCommand validation, and translation for all action types (558 total)
v0.16.0 on 27th of March, 2026
- Add
trade_outcome_type.pywithTradeOutcomeTypeenum (ACK, PARTIAL, FILLED, REJECTED, EXPIRED, CANCELED) - Add
trade_outcome.pywith frozenTradeOutcomedataclass and outcome-type-specific validation (fill outcomes requireactual_fees) - Add
inbound_connector.pywithInboundConnectorprotocol for receiving outcomes from Trading sub-system - Add
order_context.pywith frozenOrderContextdataclass bridging outcome processing with order metadata (side, trade_id, estimated_fees) - Add
process_result.pywith frozenProcessResultdataclass for outcome processing results - Extend
CapitalController.order_fill()withactual_feesparameter and fee reconciliation againstfee_reserve - Add
outcome_processor.pywithOutcomeProcessorrouting outcomes to Capital Controller lifecycle methods - Add position growth with VWAP entry price calculation on entry fills
- Add position reduction with
pending_exitclearing on exit fills, removing closed positions from state - Add 126 tests covering TradeOutcome validation, OutcomeProcessor routing, position growth/reduction, and fee reconciliation (638 total)
v0.17.0 on 28th of March, 2026
- Add
StateStoredependency toOutcomeProcessorfor WAL persistence of risk events - Compute realized P&L in
_reduce_positionusing side-aware formula:side_multiplier × (fill_price - entry_price) × fill_sizewhereside_multiplieris-1for shorts - Add
_update_strategy_risk_state()to update per-strategystrategy_realized_pnl,rolling_loss_24h/7d/30d, andhigh_water_mark - Update instance-level
cumulative_realized_pnltriggeringrecompute_drawdown_metrics()on exit fills - Persist
StrategyEventto WAL viaStateStore.append_event()on every exit fill - Add 7 tests covering risk metrics recalculation, strategy isolation, and WAL persistence (652 total)
v0.18.0 on 31st of March, 2026
- Add
manifest.pywith frozenStrategySpecdataclass (strategy_id, file, permutation_ids, capital_pct) and frozenManifestdataclass (capital_pool, strategies) - Add
load_manifest()to parse YAML manifest files withallocated_capitalceiling validation - Add
_validate_strategy_files()to verify strategy .py files exist and have valid Python syntax viaast.parse() - Add
pyyaml>=6.0runtime dependency and mypy override for yaml module - Add 58 tests covering StrategySpec, Manifest, load_manifest parsing, and file validation (714 total)
v0.19.0 on 31st of March, 2026
- Add
base.pywithStrategyABC definingon_save() → bytesandon_load(bytes) → Nonelifecycle hooks for state persistence - Add
loader.pywithload_strategy_class()for dynamic import from .py files andinstantiate_strategy()for creating Strategy instances from manifest specs - Add path traversal prevention and ABC inheritance validation in strategy loader
- Add 27 tests covering Strategy ABC, on_save/on_load lifecycle, and dynamic loading (742 total)
v0.20.0 on 1st of April, 2026
- Add
params.pywithStrategyParamsfrozen dataclass wrapping manifest parameters - Add
signal.pywithSignalfrozen dataclass for predictor function output (predictor_fn_id, values dict, timestamp) - Add
action.pywithActionTypeenum (ENTER, EXIT, MODIFY, ABORT) andActionfrozen dataclass - Add
context.pywithStrategyContextfrozen dataclass (positions, capital_available, operational_mode) - Extend
StrategyABC with five event callbacks:on_startup,on_signal,on_outcome,on_timer,on_shutdown - Wire new types in
nexus/strategy/__init__.pypublic API - Add 57 tests covering event dispatch types and Strategy callbacks (772 total)
v0.21.0 on 2nd of April, 2026
- Add
executor.pywithStrategyExecutorclass wrapping Strategy instance withthreading.Lockfor serialized callback execution - Add
runner.pywithStrategyRunnerclass orchestrating multiple executors by strategy_id - Add 29 tests covering executor delegation, runner routing, unknown strategy rejection, and concurrent dispatch serialization (806 total)
v0.22.0 on 2nd of April, 2026
- Add
nexus/startup/module withStartupSequencerandStartupError - Add
StartupSequencer.start()orchestrating full startup sequence: recover state, register with trading, reconcile capital, load manifest, instantiate strategies, restore strategy state, replay events, wire predictor_fns, register timers, determine mode, dispatch startup - Add state recovery via
StateStore.recover()delegation - Add manifest loading and strategy instantiation with executor/runner building
- Add external integration stubs:
_register_with_trading(TD-005),_reconcile_capital(TD-006) - Add state restoration stubs:
_restore_strategy_state(TD-007),_replay_strategy_events(TD-008) - Add runtime setup stubs:
_wire_predictor_fns(TD-009),_register_timers(TD-010) - Add startup dispatch:
_determine_modestub (TD-011, always ACTIVE),_dispatch_startupcalling strategies with context - Add 32 tests covering construction validation, state recovery, stubs, manifest loading, strategy instantiation, dispatch, and integration (838 total)
v0.23.0 on 3rd of April, 2026
- Add
shutdown_sequencer.pywithShutdownSequencerorchestrating graceful termination: stop signals → stop timers → dispatch on_shutdown → submit actions → wait terminal → dispatch on_save → persist strategy state → final checkpoint → deregister - Add
_dispatch_shutdown()building per-strategy context and collecting shutdown actions - Add
_submit_actions()filtering EXIT/ABORT actions, skipping ENTER/MODIFY (TD-015 for Validator integration) - Add
_dispatch_save()calling strategy on_save() and collecting state blobs - Add
_persist_strategy_state()writing strategy state to individual.binfiles with atomic tmp+rename pattern - Add
_final_checkpoint()delegating toStateStore.checkpoint()for final snapshot + WAL truncation - Add
ShutdownErrorexception toerror.py - Add
StrategyExecutor.dispatch_save()andStrategyRunner.dispatch_save()for on_save lifecycle dispatch - Add
InstanceConfig.shutdown_wait_timeout_secondsandshutdown_abort_timeout_secondsfor configurable shutdown timeouts - Add shutdown stubs:
_stop_signals(TD-013),_stop_timers(TD-014),_wait_terminal(TD-016),_deregister(TD-012) - Fix import-in-method anti-pattern in
sequencer.pyby moving structlog to module level - Add 25 tests covering construction validation, dispatch shutdown, submit actions filtering, dispatch save, persist strategy state, final checkpoint, full shutdown sequence, executor/runner dispatch_save, and config timeout validation (863 total)
v0.24.0 on 5th of April, 2026
- Add crash-only design: fresh start and crash recovery share same code path with no branching
- Add
_recover_state()creating initialInstanceStatewhenStateStore.recover()returns None - Add
strategy_state_pathparameter toStartupSequencerfor strategy state restoration directory - Add
_restore_strategy_state()loading.binfiles into strategies viadispatch_load()(completes TD-007) - Add
StateStore.read_events()to readSTRATEGY_EVENTentries from WAL - Add
Strategy.on_event_replay()optional callback with default no-op for event replay during recovery - Add
StrategyExecutor.dispatch_event_replay()andStrategyRunner.dispatch_event_replay()methods - Add
_replay_strategy_events()dispatching WAL events to strategies for state reconstruction (completes TD-008) - Add crash-only verification tests proving same code path for fresh start and crash recovery
- Add path traversal validation for strategy_id in state restoration
- Add StartupError wrapping for read_events() failures
- Add 28 tests covering state restoration, event replay, crash-only design verification, and validation (891 total)
v0.25.0 on 14th of April, 2026
- Add
lifecycle_result.pywithLifecycleResultdataclass andFailureCategoryenum (EXPECTED_MISS, INVARIANT_BREACH) replacing bare bool returns in capital lifecycle methods (TD-003) - Refactor
CapitalControllerlifecycle methods (release_reservation,send_order,order_ack,order_reject,order_fill,order_cancel) to returnLifecycleResultwith classified reason codes - Convert
OutcomeProcessorinvariant breach paths to raiseRuntimeErrorfor entry/exit fills on missing positions or overfills - Enforce UTC-only timestamps across all domain types:
Signal,TradeOutcome,StrategyEvent,Reservation,TrackedOrder,TradeCommand(TD-004) - Reject whitespace-padded
strategy_idinStrategySpec.__post_init__(TD-017) - Add version-dispatched deserialization to WAL codec with
_decode_state_v1routing on embedded_vfield (TD-001) - Preserve
STRATEGY_EVENTWAL entries across checkpoint for rolling loss window recovery (TD-002) - Add
SensorSpecfrozen dataclass for Limen Sensor configuration (experiment_dir, permutation_ids, interval_seconds) - Replace
StrategySpec.permutation_idswithStrategySpec.sensors: tuple[SensorSpec, ...]and updateload_manifestYAML parsing - Add
vaquum_limenas runtime dependency (installed fromgit+https://github.com/Vaquum/Limen) - Add
WiredSensordataclass and implement_wire_sensors()inStartupSequencer— callsTrainer(experiment_dir).train(permutation_ids)to produce Sensors during startup (TD-009) - Add
signal_producer.pywithproduce_signal()for live feature preparation vialimen_manifest.prepare_data()and predict-to-Signal translation - Add
predict_loop.pywithPredictLooptimer-based signal generation — per-sensorthreading.Timeratinterval_secondscallingproduce_signal→dispatch_signal - Implement
_stop_signals()inShutdownSequencerviaPredictLoop.stop()(TD-013) - Add
praxis_outbound.pywithPraxisOutboundsync-to-async bridge —asyncio.run_coroutine_threadsafeforsubmit_command,register_account,deregister_account,pull_positions - Add
praxis_inbound.pywithPraxisInboundqueue-basedreceive_outcome()consuming fromqueue.Queue[TradeOutcome] - Implement
_register_with_trading()and_deregister()viaPraxisOutbound(TD-005, TD-012) - Wire
PraxisOutboundinto_submit_actions()for shutdown EXIT/ABORT filtering; actual submission pending Action fields (TD-015, TD-023) - Implement
_wait_terminal()pollingPraxisInboundfor terminal outcomes with configurableshutdown_timeout(TD-016) - Implement
_reconcile_capital()pulling Praxis positions, comparing by trade_id, updatingposition_notional(TD-006) - Split
test_manifest.pyintotest_sensor_spec.py,test_strategy_spec.py,test_manifest.py - Add
docs/TechnicalDebt.mdentries TD-019 through TD-024 for deferred work - Add 53 tests across new modules (944 total)
v0.26.0 on 15th of April, 2026
- Add
TimerSpecfrozen dataclass for strategy timer configuration (timer_id, interval_seconds) - Add optional
timersfield toStrategySpecwith duplicate timer_id rejection - Update
load_manifestYAML parsing for optionaltimersentries - Add
timer_loop.pywithTimerLoopclass — per-strategythreading.Timerscheduling foron_timercallbacks (TD-010) - Implement
_register_timers()inStartupSequencer— extracts timer specs from manifest (TD-010) - Implement
_stop_timers()inShutdownSequencerviaTimerLoop.stop()(TD-014) - Add
health_evaluator.pywithHealthEvaluator,HealthSnapshot, andHealthThresholdsfor three-threshold mode determination (warn/breach/halt) (TD-011) - Implement
_determine_mode()inStartupSequencer— evaluates health snapshot against thresholds, defaults to ACTIVE when no health data available - Replace O(N) dictionary scan in
_purge_expiredwithheapq-based expiry tracking (TD-018) - Replace O(N) dictionary scan in
make_duplicate_order_hookwithcollections.deque-based chronological expiry (TD-018) - Add
docs/TechnicalDebt.mdentries TD-025 (thread churn) and TD-026 (health data source) - Add 28 tests across new modules (972 total)
v0.27.0 on 18th of April, 2026
- Promote all inline imports across
nexus/andtests/to top-of-file (health_evaluator.py, test files forwal_codec,signal_producer,wire_sensors,instance_state,timer_loop,startup_sequencer,strategy_event_types,strategy_base) - Add Action trade fields per RFC §Action Parameters in
action.py:direction,size,execution_mode,order_type,execution_params,deadline,trade_id,command_id,maker_preference,reference_price; per-action_type required-field validation in__post_init__via_validate_action_type_requirements()(TD-023.1) - Split Action reference fields per RFC-3001 Stage 1: EXIT requires
trade_id; MODIFY/ABORT requirecommand_id(wastrade_id) (TD-023.2) - Mirror Praxis enums in
order_types.py:ExecutionMode,OrderType,MakerPreference. RetypeAction.execution_mode/order_type/maker_preferencefrom free strings to these enums (TD-023.3) - Extend
TradeCommandwithexecution_mode,order_type,execution_params,deadline,maker_preference,reference_price; AMEND/CANCEL invariants enforce these are absent. Updatetranslate_to_trade_commandto take anActionand populate these on NEW_ORDER (TD-023.3) - Wire real fields through
PraxisOutbound.send_command:order_type,execution_mode,execution_params,maker_preference,reference_priceflow from the TradeCommand instead of placeholderNonevalues (TD-023.4) - Add
PraxisOutbound.send_abortwrapping PraxisTrading.submit_abortviaasyncio.run_coroutine_threadsafe(newsubmit_abort_fnparameter) - Wire
ShutdownSequencer._submit_actions: EXIT actions translate throughtranslate_to_trade_commandand submit viasend_command; ABORT actions submit viasend_abortwith reason'shutdown'; returned command_ids stored in_submitted_command_ids. Optionalconfig: InstanceConfigparameter onShutdownSequencer(TD-023.5) - Wire ABORT escalation in
_wait_terminal: on first-round timeout, send ABORT for each pending command (reason'shutdown_escalation') and re-poll with half the originalshutdown_timeoutbefore giving up. Refactor poll loop into_poll_until_terminaland abort fan-out into_escalate_abort_pending(TD-023.6) - Import Praxis-only positions during reconciliation:
StartupSequencer._reconcile_capitalnow constructs a NexusPosition(strategy_id / symbol / side / size / entry_price) and inserts it intoinstance_state.positionswhen a Praxis position has no Nexus counterpart, provided required fields are present (TD-024) - Add
PraxisOutbound.get_health_snapshot(account_id)wrapping PraxisTrading.get_health_snapshotviaasyncio.run_coroutine_threadsafe(newget_health_snapshot_fnparameter) (TD-026.1) - Add
health_loop.pywithHealthLoop— periodic timer pulls aHealthSnapshotfrom a configurable provider, evaluates viaHealthEvaluator, and updatesinstance_state.modeon transition. Provider/evaluator exceptions are logged-and-swallowed;startis idempotent;tick_once()exposed for synchronous callers (TD-026.2) - Rename
_validate_required_fieldsto_validate_action_type_requirementsinAction(existing per-action_type checks; the rename reflects that field-shape validation already happened earlier in__post_init__) - Add 62 tests across new and updated modules (1034 total)
v0.28.0 on 19th of April, 2026
- BREAKING: Move instance identity and capital ceiling into the strategy manifest.
Manifestgains requiredaccount_id: strandallocated_capital: Decimalfields, with internal validation thatcapital_pool ≤ allocated_capital. Manifest YAML files must now declareaccount_id:andallocated_capital:alongside the existingcapital_pool:andstrategies:blocks - BREAKING: Drop the
allocated_capitalparameter fromload_manifest(path); the ceiling is sourced from the manifest itself - BREAKING: Drop
allocated_capitalandaccount_idconstructor parameters fromStartupSequencer; both are derived from the loaded manifest at runtime - Reorder startup sequence to call
_load_manifestfirst (was step 4);_recover_state,_register_with_trading, and_reconcile_capitalall read identity and capital fromself._manifest - BREAKING: Remove
allocated_capitalfield fromInstanceConfig— the ceiling no longer belongs in runtime/validator config, it is per-account manifest state - Rename
InstanceState.from_config(config)→InstanceState.fresh(capital_pool)— the factory seedsCapitalState.capital_poolfromManifest.capital_pool(the operational allocation), notManifest.allocated_capital(the infrastructure ceiling); drops the unusedInstanceConfigdependency fromnexus.core.domain - Update manifest YAML fixtures, direct
Manifest(...)constructions,InstanceConfig(...)callers, andInstanceState.fresh(...)callers across all tests - Add
load_manifestvalidation tests for missing / invalid / non-positiveallocated_capitaland for blankaccount_id
v0.29.0 on 22nd of April, 2026
- Add
action_submit.pywithsubmit_actions(actions, *, strategy_id, config, praxis_outbound, validator, build_context, now)— runtime helper that pushes strategy-emitted actions throughValidationPipeline→translate_to_trade_command→PraxisOutbound.send_commandforENTER/EXIT/MODIFY, and directly throughPraxisOutbound.send_abortforABORT. Returns per-actionSubmissionOutcome(SUBMITTED/REJECTED/SUBMIT_FAILED/INVALID) so callers can record Praxis-assigned command_ids (PT.1.1) - Wire
PredictLoop._tickto forwarddispatch_signalreturn value to an injectedaction_submit: Callable[[list[Action], str], None] | Nonecallback. Constructor accepts optionalaction_submit=None(back-compat for tests that do not exercise the submission path); submitter exceptions are logged-and-swallowed so a bad submit does not kill the loop (PT.1.2) - Wire
TimerLoop._tickthe same way — dispatch_timer return value flows throughaction_submitwith identical exception semantics (PT.1.3) - Add public
StartupSequencer.instance_stateandStartupSequencer.manifestproperties returning the liveInstanceState/ loadedManifest(orNonebefore_load_manifest/_recover_statehave run). Returns the actual mutable state object — not a copy — so runtimecontext_providercallers observe reservations, position changes, and operational-mode transitions made by validator stages and outcome processing (PT.2.1) - Add
outcome_loop.pywithOutcomeLoop(runner, praxis_inbound, state, context_provider, resolve_strategy_id, action_submit=None)— single worker-thread loop pollingPraxisInbound.receive_outcome(), resolvingcommand_id→strategy_idvia an injected callable, dispatchingon_outcomethroughStrategyRunner, and forwarding any capturedlist[Action]back throughaction_submit. Idempotentstart()/stop(),tick_once()for test harnesses, exception-absorbent worker (PT.3.1) - Extend
ShutdownSequencerwith optionaloutcome_loop: OutcomeLoop | Noneconstructor parameter and a new_stop_outcome_loop()step invoked after_stop_timers()and before_wait_terminal(). OutcomeLoop and_wait_terminalboth consume from the samePraxisInboundqueue, so leaving the loop running during shutdown would steal terminal outcomes out of the shutdown-path poll (PT.3.3) - Add 11 tests across
test_outcome_loop.py(8: empty-queue, known outcome, unresolved strategy skip, action forwarding, no-op dispatch, exception absorption, start/stop idempotency, worker-thread consumption) and newTestStopOutcomeLoopclass intest_shutdown_sequencer.py(3: stop called, no-loop fallback, call ordering before_wait_terminal)
v0.30.0 on 24th of April, 2026
- Pin
vaquum_limen @ git+https://github.com/Vaquum/Limen@v2.4.3inpyproject.tomlso the Nexus and Praxis venvs converge on a single Limen release; without a version constraint the two venvs drifted (vaquum_limen1.52.0 in the Nexus venv vs 2.0.0 in the Praxis venv) and an experiment trained in one could not be loaded by the other'sTrainer(PT-FIX-4) - Add optional
process_outcome: Callable[[TradeOutcome], None] | Noneparameter toOutcomeLoop; the launcher uses it to apply venue-lifecycle effects toCapitalControllerviaOutcomeProcessor.process(...)beforerunner.dispatch_outcomeruns, so capital state is current when the strategy callback fires. Processor exceptions are caught and logged; the strategy callback still fires (PT-FIX-8) - Cache one
Trainerper resolvedexperiment_dirinsideStartupSequencer._wire_sensors; subsequentTrainerconstructions for the same directory receivedata=cached._dataso the same frozen slice flows through every permutation reconstructed from that experiment. Avoids fetching the live Hugging Face dataset twice for SensorSpecs that share an experiment dir (PT-FIX-9) - Add 3 tests in
test_wire_sensors_data_cache.pyverifying shared-dir reuse, distinct-dir isolation, and single-sensor passthrough (1069 total)
v0.31.0 on 25th of April, 2026
- Add operational-mode enforcement in
validate_intake_stage; ENTER actions are rejected with reasonINTAKE_MODE_BLOCKS_ENTERwhenstate.mode.mode != OperationalMode.ACTIVE, and EXIT/MODIFY actions are rejected withINTAKE_MODE_HALTED_BLOCKS_TRADINGwhen mode is HALTED. CANCEL/ABORT remain available in HALTED so an operator can wind pending orders down without flipping the mode back manually. Closes the gap whereHealthLoopflippedstate.modeto REDUCE_ONLY/HALTED on health degradation but no validator stage actually enforced the documented contract (PT-FIX-15) - Add optional
action_submit: Callable[[list[Action], str], None] | Noneconstructor parameter and a_pending_startup_actionsbuffer toStartupSequencer._dispatch_startupnow forwards via the constructor-injected submitter when available; otherwise it stashes per-strategy actions for the launcher to drain via the new publicdrain_pending_startup_actions(submitter)method (idempotent, per-strategy exception-safe). Closes the gap where strategyon_startuprecovery actions (e.g. closing stale positions left over from a prior crash) were silently dropped (PT-FIX-16) - Add
WriteAheadLog.read_safe()as a single-pass reader that silently stops at the first short-read or CRC mismatch. SwitchStateStore.__init__,StateStore.recover,StateStore.read_events, andWriteAheadLog.truncate_keeping_eventsto consume the safe variant so a process killed mid-appendno longer blocks the next boot or checkpoint.read_allretains strict raise-on-corruption semantics for callers that want it. AddWriteAheadLog.validate_magic()and call it fromStateStore.__init__so a non-WAL/garbage file fails loud at boot rather than at the first runtimeappend(). The torn record itself is unrecoverable and stays discarded; the file is cleaned up by the nextappend()via existing self-truncation (PT-FIX-17) - Soften
StartupSequencer._wire_sensorsso a single sensor failure no longer takes down the whole account. Each sensor wires inside an isolated try/except; failures log full context (strategy_id,experiment_dir,permutation_ids,error) and the loop continues. The account aborts only when every attempted sensor failed — running with zero signal sources would be silent dead air (PT-FIX-18) - Add 24 tests across
test_validator_intake_stage.py(8 new mode-enforcement cases),test_startup_sequencer.py(5 new pending-startup cases),test_wal_torn_tail.py(9 new torn-tail cases), andtest_wire_sensors_isolation.py(4 new isolation cases) (1098 total)
v0.32.0 on 26th of April, 2026
- Add
_halt_state_modeas the first step ofShutdownSequencer.shutdown(); flipsstate.modetoOperationalMode.HALTEDbefore any loop is stopped so any in-flight outcome dispatch's downstream ENTER is rejected by the validator's_check_operational_modestage instead of leaking past_dispatch_shutdownto the venue (PT-FIX-25) - Default
StartupSequencer._determine_modetoOperationalMode.REDUCE_ONLYwhen nohealth_snapshotis wired at boot, instead of the priorACTIVE. Mirrors the resolved mode intostate.modeso the validator's_check_operational_modestage sees the same value the sequencer carries intoStrategyContext. Closes the ~5 s permissive window where strategies'on_startupENTERs reached the venue before the firstHealthLooptick had landed (PT-FIX-26) - Add
bridge_to_capital(controller, outcome)helper that invokesCapitalController.send_order(reservation_id, command_id)for SUBMITTED outcomes carrying a reservation. Document theoutcome.command_id↔CapitalController.send_order(order_id=...)contract onOutcomeProcessor.processso a name swap is caught at review. Without this wiring, every ACK/FILL outcome returnedINVARIANT_BREACH: order not foundsilently (PT-FIX-27) - Add
outcome_processor: OutcomeProcessor | Noneconstructor parameter and_apply_terminal_outcomehelper toShutdownSequencer;_submit_exitnow builds and stores anOrderContextper command, and_poll_until_terminalroutes FILLED outcomes throughOutcomeProcessor.processso shutdown EXIT fills decrementstate.positions[trade_id].sizecorrectly. Pre-fix, the OutcomeLoop was already stopped before_submit_actions, so shutdown EXIT FILLs were silently dropped at the state level — leaving the next boot to recover stale positions (PT-FIX-31) - Add
ValidationStage.RISKto the EXIT/ABORT/CANCEL bypass set in_should_bypass_stage. Risk gates new exposure, not exit; pre-fix a drawdown-driven RISK denial blocked exits exactly when they mattered most (PT-FIX-32) - Exempt EXIT/ABORT/CANCEL from the
INTAKE_ORDER_NOTIONAL_ZEROcheck invalidate_intake_stage. Size-only exits with zero notional now pass intake; ENTER and MODIFY still require positive notional (PT-FIX-33) - Tighten the all-sensors-failed guard in
StartupSequencer._wire_sensorsso a manifest declaring zero sensor specs raisesStartupError('wire_sensors', 'manifest declared 0 sensor specs across all strategies')instead of silently booting into a permanently dead account with no signal source (PT-FIX-34) - Add
CapitalController.reconcile_at_boot(positions=...)that resets strandedreservation_notional/in_flight_order_notional/working_order_notionalaggregates carried over from a crashed prior boot, and rebuildsper_strategy_deployedfrom the live positions so it sums toposition_notionalexactly. The launcher calls this after constructingCapitalController. Fixes the first-ENTER attribution-mismatch denial that would otherwise permanently block new ENTERs on crash-recovery boot (PT-FIX-35, PT-FIX-41) - Replace the bare
state.positions[action.trade_id]lookup in_build_exit_order_contextwith.get()+ explicitValueErrorso a position removed by a concurrent OutcomeLoop tick during shutdown does not propagateKeyErrorpast the surroundingtry/except ValueError(PT-FIX-36) - Add
ValidationStage.PRICEto the EXIT/ABORT/CANCEL bypass set, completing the rule "any stage gating new exposure must not block exits". Pre-fixPRICE_BOOK_STALEandPRICE_SPREAD_LIMITdenials silently dropped EXITs exactly when stale-orderbook conditions made fast exits critical (PT-FIX-37) - Route PARTIAL fills (not just FILLED terminals) through
_apply_terminal_outcomein_poll_until_terminalso a partial fill on a shutdown EXIT followed by a CANCELED/EXPIRED terminal still decrementsstate.positions[trade_id].size. Pre-fix the partial-fill amount was silently lost (PT-FIX-38) - Accept
OrderLifecycleState.WORKING(in addition to IN_FLIGHT) inCapitalController.order_rejectso a venue REJECTED outcome racing past an ACK releasesworking_order_notionalinstead of leaving capital parked. Pre-fix the WORKING capital was permanently leaked because TTL eviction only covers_reservations, not_orders(PT-FIX-40) - Re-check
_runningunder_lockinsideHealthLoop._apply_snapshotbefore writingstate.mode, so a tick already past the top-level_runningguard cannot overwrite the PT-FIX-25 HALTED ratchet afterstop()returned. Newrespect_running: bool = Trueparameter;tick_once()passesFalsefor callers driving the loop manually (PT-FIX-42) - Mirror PT-FIX-40 in
CapitalController.order_cancel: accept both IN_FLIGHT and WORKING. A venue EXPIRED/CANCELED outcome for an order that never received an ACK now releasesin_flight_order_notionalinstead of leaving capital parked (PT-FIX-43) - Add
non_pending_outcome_handler: Callable[[TradeOutcome], None] | Noneconstructor parameter toShutdownSequencer._poll_until_terminalnow routes outcomes whosecommand_idis NOT in the shutdown's pending set through the handler (the launcher passes itsprocess_outcomeclosure) instead of silently discarding them withcontinue. Pre-fix pre-shutdown ENTER FILLEDs that arrived after_stop_outcome_loopwere lost — position state drifted from venue truth on every subsequent boot (PT-FIX-44) - Replace the dimensionally-wrong fallback in
_build_exit_order_context—approx_notional <= _ZEROnow raisesValueErrorinstead of silently assigningaction.size(base-asset units) into the notional slot (quote-asset units). The branch is unreachable under currentPositioninvariants but the prior fallback would have constructed anOrderContextwith garbage if it ever fired - Add structured logs to each early-return in
bridge_to_capital—debugfor routine cases (REJECTED/SUBMIT_FAILED status, no reservation on EXIT/MODIFY),warningfor the unexpected case (SUBMITTED outcome with nocommand_id). Pre-fix all three early-returns were silent, leaving no breadcrumbs for debugging - Add 16-case parametrized contract test in
test_validator_pipeline_executor.py(TestSafetyBypassContract) asserting every gating stage (RISK / PRICE / CAPITAL / HEALTH / PLATFORM_LIMITS) is in the EXIT/ABORT/CANCEL bypass set, plus an anti-regression that INTAKE is deliberately NOT in the bypass set. A future stage addition that should bypass for exits will be caught by the parametrize list - Add 84 tests across
test_shutdown_sequencer.py(33 new acrossTestShutdownSequence,TestShutdownExitAppliesToState,TestSubmitExitMissingPositionRace,TestShutdownExitPartialFill,TestNonPendingOutcomeHandler),test_capital_controller.py(16 new acrossTestReconcileAtBoot,TestReconcileAtBootRebuildsPerStrategyDeployed,TestOrderReject,TestOrderCancel),test_outcome_processor.py(2 new inTestOutcomeProcessorRejectandTestOutcomeProcessorCancel),test_validator_pipeline_executor.py(20 new safety-bypass / PRICE-bypass /TestSafetyBypassContracttests),test_validator_intake_stage.py(3 new EXIT-with-zero-notional cases),test_startup_sequencer.py(3 new — wire_sensors zero-spec, determine_mode REDUCE_ONLY default, mirror state.mode),test_health_loop.py(2 new in-flight-tick race cases), andtest_action_submit.py(4 new inTestBridgeToCapital). Total Nexus tests: 1182 - Add
docs/TechnicalDebt.mdentries TD-027 (bareassertinOutcomeProcessorfill handlers, fires underpython -O), TD-028 (loop.stop()cancel-but-no-join pattern across OutcomeLoop / PredictLoop / TimerLoop / HealthLoop, with round-9 refinement on shutdown EXIT orphan-context cleanup), TD-029 (_grow_positiondefensive gap ontrade_id=None), TD-030 (_poll_until_terminalmisleading double-dispatch structure), TD-031 (PraxisOutboundtrade_id/command_id contract not asserted), TD-032 (on_startupcapital_availableshows gross budget, not net of deployed), TD-033 (multi-process WAL TOCTOU betweenStateStore.__init__andrecover())
v0.33.0 on 29th of April, 2026
- Add required
avg_cost_basis: Decimalfield toPosition— VWAP-with-fees cost per unit, maintained byOutcomeProcessor._grow_positionon every entry FILL. WAL codec encodes the new field; legacy snapshots without it decode toentry_price(best-effort default — fees lost). Praxis-imported positions inStartupSequencer._import_praxis_positioninitialize the same way (BLOCKER-A.1) - Add
CapitalController.order_exit(strategy_id, cost_basis_released)lifecycle method that decrementsposition_notionalandper_strategy_deployed[strategy_id]by the released cost basis, withINVARIANT_BREACHguard against drivingposition_notionalnegative. Mirrorsorder_fillfor the EXIT direction (BLOCKER-A.1) - Wire EXIT FILL through
order_exitinOutcomeProcessor._handle_fill— whennot context.is_entry, callorder_exitbefore_update_position_on_fill()/_reduce_position()so capital aggregates are decremented byposition.avg_cost_basis * fill_sizewithout mutating positions onINVARIANT_BREACH. Closes the round-trip conservation gap that locked accounts after ~7 round-trips at 80% utilization (or ~1.5 round-trips per strategy at the per-strategy budget cap) — eleven audit rounds missed this because EXIT-FILL tests assertedsuccessandrealized_pnlbut neverstate.capital.position_notionalorper_strategy_deployed(BLOCKER-A.3) - Add
pending_exitincrement insubmit_actions— for EXIT actions with status SUBMITTED, afterpraxis_outbound.send_commandreturns,state.positions[action.trade_id].pending_exit += ctx.order_size(matches the size thattranslate_to_trade_command(... size=context.order_size ...)actually submitted, so the validator'sINTAKE_EXIT_SIZE_EXCEEDS_REMAININGdefense compares like-with-like). Defensiveis Noneguards against missing position. The defense atintake_stage.py:248-256was structurally unreachable pre-fix because the field was decremented in 4 sites and incremented nowhere — strategies could submit two overlapping EXITs each sized atposition.size, the second oversold and crashed_reduce_position. Eleven audit rounds missed this because the existing intake-stage test pre-populatedpending_exit=0.2directly in setup (BLOCKER-C) - Replace the warn-only "position in Nexus but not in Praxis" loop in
StartupSequencer._reconcile_capitalwith an eviction loop that pops every Nexus-onlytrade_idand logs at WARNING with the strategy_id / size / entry_price. Closes the recovery path that leftper_strategy_deployedrebuilt from stale entries →'Per-strategy deployed attribution mismatch for non-flat state'denial that rejected every ENTER for the rest of the boot. Reachable on every paper-trade boot following any unclean shutdown where positions cycled through the Praxis WS path (BLOCKER-B.3, B.4) - Capital-aggregate post-conditions on every EXIT-touching test in
test_outcome_processor.py(TestOutcomeProcessorRejectEXIT cases,TestRiskMetricsRecalculation::test_exit_fill_*,TestCancelUsesRemainingSize). Adds shared_prime_open_position_capital(ctrl, strategy_id, size, avg_cost_basis)helper. Closes the lens-gap that hid the EXIT-FILL conservation bug across eleven audit rounds (BLOCKER-A.7) - Add 22 new tests across
test_outcome_processor.py(7 inTestCapitalConservationOnExit— full round-trip, partial exit, VWAP-across-two-fills via real CapitalController + pure unit, 8-cycle no-leak proof, INVARIANT_BREACH guard, multi-position cross-strategy attribution isolation),test_position.py(4 —avg_cost_basisinvariants),test_wal_codec.py(1 round-trip + 1 legacy decode),test_startup_sequencer.py(3 — Nexus-only eviction, both-present regression, mixed scenario), andtest_action_submit.py(6 inTestPendingExitIncrement— increment on SUBMITTED, no-increment on REJECT/SUBMIT_FAILED/ENTER/missing-trade_id, cross-tick overlap denial via realvalidate_intake_stage). Total Nexus tests: 1199 - Replace silent-None sentinel on zero
avg_cost_basisinOutcomeProcessor._reduce_positionwith an explicitif position.avg_cost_basis == _ZEROcheck + WARNING log naming the trade_id / fill_size / entry_price. Pre-fixcost_basis_released if cost_basis_released > _ZERO else Nonesilently bypassed the capital decrement when avg_cost_basis was zero (legacy snapshot, placeholder reused as real, or invariant break in_grow_position); post-fix the operator sees the leak and the underlying invariant break is investigable - Gate
_compute_exit_cost_basisonoutcome.fill_size > position.size— returnNonesoorder_exitis skipped before_reduce_positionraisesRuntimeError. Pre-fix capital was already decremented byposition.avg_cost_basis * fill_sizeat the time of the raise, leavingCapitalStatedivergent frompositions(capital missing the closed position's cost basis while the position still held its full size). Inverse-case gap surfaced in PR #47 review - Gate
_compute_exit_cost_basisonposition.strategy_id != context.strategy_id— returnNoneand log WARNING. Pre-fix a context wired to a different strategy than the position's owner would decrement the wrongper_strategy_deployedbucket → attribution drift / underflow on the owning strategy - Update
_compute_exit_cost_basisdocstring to distinguish the two return-None classes: cases where the EXIT legitimately should not decrement capital (avg_cost_basis=0, overfill, strategy_id mismatch) versus cases that suppress the capital decrement only because the position layer will still raise (missing trade_id, absent position) (Copilot PR #47 review) - Update
CapitalController.order_exitdocstring — exit fees are NOT touched here AND are NOT deducted fromrealized_pnl(which is gross PnL(fill_price - entry_price) * fill_size); pre-fix wording implied fees appeared in realized_pnl (Copilot PR #47 review) - In
_reduce_position, update theavg_cost_basis == _ZEROWARNING text to reflect thatreconcile_at_bootcan no longer recover this case (it now rebuilds frompos.avg_cost_basisdirectly), and addposition_size/position_avg_cost_basisto the extra context for incident response (Copilot PR #47 review) - In
StartupSequencer._reconcile_capital, setnexus_pos.size = qtyafter the size-mismatch warning — Praxis is the live truth post-WS-applied state. Pre-fixposition_notional(Praxis qty) and downstreamper_strategy_deployed(stale Nexus qty) diverged → permanent'Per-strategy deployed attribution mismatch for non-flat state'denial of every subsequent ENTER following any reboot from a crash mid-fill where the persisted Nexus snapshot lagged the WS-applied Praxis state - In
StartupSequencer._reconcile_capital, fall back fromnexus_pos.avg_cost_basis == _ZEROto the Praxisavg_entry_price(ornexus_pos.entry_priceif Praxis price is also zero) soposition_notionalstays in the right ballpark andorder_exitdoes not fireINVARIANT_BREACHon the next EXIT fill for legacy snapshot positions (Copilot PR #47 review) - Persist the fallback price onto
nexus_pos.avg_cost_basisin_reconcile_capitalso downstreamreconcile_at_bootand_compute_exit_cost_basissee a consistent non-zero cost basis (Copilot PR #47 review) - In
CapitalController.reconcile_at_boot, apply the sameavg_cost_basis == _ZEROfallback toentry_price(with WARNING) when rebuildingper_strategy_deployed, so a Position whoseavg_cost_basiswas never repopulated does not under-attribute deployed capital and immediately re-trigger the attribution-mismatch denial (Copilot PR #47 review) - Switch
submit_actionspending_exitincrement fromaction.sizetoctx.order_size— the latter is whattranslate_to_trade_command(... size=context.order_size ...)actually sends. Ifbuild_contextrounds or clamps the size away fromaction.size,pending_exitnow matches what was validated and submitted, keeping theINTAKE_EXIT_SIZE_EXCEEDS_REMAININGdefense reliable (Copilot PR #47 review) - Add
per_strategy_deployed[strategy_id]guard inCapitalController.order_exit— returnINVARIANT_BREACHwhencost_basis_releasedexceeds the per-strategy bucket, before the globalposition_notionalcheck would have allowed the mutation. Pre-fix onlyposition_notionalwas checked; a missing or stale per-strategy entry could be driven negative (or dropped via_adjust_strategy_deployed), leavingposition_notionaldecremented while attribution was corrupted, and the nextcheck_and_reservewould fire the attribution-mismatch denial with no recovery path until reboot (Copilot PR #47 review) - Add
docs/TechnicalDebt.mdentries TD-040 (WAL codec back-compat: legacy snapshot decodesavg_cost_basisfromentry_price, losing entry-fee portion of cost basis until positions cycle through fresh ENTER FILLs) and TD-041 (pending_exitincrement insubmit_actionslacks lock protection symmetric with the existing unlocked decrement sites inOutcomeProcessor; race-direction analysis shows the only failure mode is over-denial which is operationally safe today)
v0.34.0 on 30th of April, 2026
- Add
strategy_id: str | None = Nonefield toTradeCommand— wired throughPraxisOutbound.send_commandinto Praxis'sTrading.submit_command(strategy_id=...)kwarg. NEW_ORDER carries the owner; AMEND_ORDER and CANCEL_ORDER rejectstrategy_id is not None. Closes the TD-E missing-kwarg root cause that left every Praxis Position withstrategy_id=None(MAJOR-O + TD-E) - Skip
qty * pricecontribution topraxis_total_notionalinStartupSequencer._reconcile_capitalwhen_import_praxis_positionreturns None — pre-fix the position was dropped fromstate.positionsbut its notional still inflatedposition_notional; downstreamreconcile_at_bootrebuiltper_strategy_deployedonly fromstate.positions(excluding the un-importable) → permanent attribution-mismatch denial of every reboot ENTER while TD-E was open. Closes the documented "self-heal" gap for any reconcile path that depends on_reconcile_capitalpost-fix (MAJOR-O) - Add
positions_lock: threading.Lock | Nonekwarg toOutcomeProcessor.__init__—_grow_positionand_reduce_positionwrap theirstate.positionsfield-assignment +delblocks under it (nullcontextwhen None for legacy single-threaded test paths). Pre-fix the lock was created by the launcher and threaded into readers (_build_strategy_context) and entry-placeholder writers (_ensure_entry_position) but never intoOutcomeProcessor's writer path — a concurrent PredictLoop iteration ofstate.positions.values()could fireRuntimeError: dictionary changed size during iteration, swallowed by PredictLoop's top-level except → silently dropped strategy ticks (MAJOR-J + TD-U) - Bump
DEFAULT_TTL_SECONDSfrom 30 to 60 inCapitalControllerso the reservation TTL exceeds thepraxis_outbound._DEFAULT_TIMEOUT(30s). Pre-fix a slowsend_commandreturning att == ttlwas followed bysend_order's_purge_expiredremoving the reservation; the pop returned None → EXPECTED_MISS → OrderContext never registered → capital permanently stuck inin_flight_order_notional(MAJOR-K) - Reorder
CapitalController.send_order—_reservations.popnow runs FIRST, then an explicitnow > reservation.expires_atcheck (with capital release on truly-past), then_purge_expiredfor housekeeping of OTHER reservations. Boundary equality (now == expires_at) now succeeds rather than being lost to the heap pop (TD-S folded into MAJOR-K) - Route shutdown EXIT REJECTED / CANCELED / EXPIRED non-fill terminals through
OutcomeProcessor.processinShutdownSequencer._apply_terminal_outcome. Pre-fix the early-return onnot is_fillleftposition.pending_exitnon-zero (incremented atsubmit_actionstime); the persisted Position then denied the next boot's first EXIT withINTAKE_EXIT_SIZE_EXCEEDS_REMAINING. Post-fix_handle_reject/_handle_cancel(withcontext.is_exit=True) invoke_clear_pending_exit(MAJOR-I + TD-N) - Add
pending_exit += context.order_sizeincrement inShutdownSequencer._submit_exitaftersend_commandsucceeds, mirroringsubmit_actions. Pre-fix the asymmetry meant a multi-EXIT shutdown for the sametrade_idskipped theINTAKE_EXIT_SIZE_EXCEEDS_REMAININGdefense and_clear_pending_exit(now wired via MAJOR-I) had no inflated value to clear (MAJOR-L) - Reset
position.pending_exit = _ZEROfor every persisted Position inCapitalController.reconcile_at_bootwith WARN if non-zero. In-memory_ordersis empty post-boot so nothing should still be in flight; the pre-fix stuck value would deny future EXITs viaINTAKE_EXIT_SIZE_EXCEEDS_REMAINING. Defense-in-depth that closes the boot-orphan REJECTED leak path that bypassed the MAJOR-I shutdown-time clearance (MAJOR-R) - Add
INTAKE_EXIT_STRATEGY_MISMATCHdenial inintake_stage— EXIT context'sstrategy_idmust match the position owner'sstrategy_id. Pre-fix intake validated onlytrade_id ∈ state.positions; on cross-strategy EXIT capital was correctly skipped (via_compute_exit_cost_basisstrategy_id guard) but_reduce_positionstill ran (decrementing position) and_update_strategy_risk_stateattributed realized P&L to the WRONG strategy bucket — corruptingrolling_loss_*andhigh_water_markon the non-owner (MAJOR-Q) - Wire
release_reservationrollback intosubmit_actions— accepts optionalcapital_controllerkwarg; on translate / send_command exception,_release_granted_reservationinvokescontroller.release_reservation(decision.reservation.reservation_id)so capital does not stay parked until the 30s TTL eviction on deterministic-failure retry storms (config bug, malformed symbol). Closes therelease_reservation-defined-but-unwired gap that the round-12 audit caught (MAJOR-G) - Add
positions_lockkwarg toShutdownSequencer.__init__;_dispatch_shutdownsnapshotsstate.positions.values()under it once per call (filtering bystrategy_idafter release). Adds an early WARNING whenoutcome_loop.runningindicates the join-timeout fired. Pre-fix a_stop_outcome_loopjoin timeout could leave the OutcomeLoop mutating positions; the unlocked iteration would fireRuntimeError: dictionary changed size during iteration, escape the per-strategy try/except, and terminate shutdown before_persist_strategy_state/_final_checkpointran — data loss (MAJOR-S) - Subtract
state.capital.per_strategy_deployed.get(strategy_id, _ZERO)from gross budget inShutdownSequencer._dispatch_shutdownsoStrategyContext.capital_availablemirrors runtime's_build_strategy_context. Pre-fix shutdown surfaced the gross strategy budget; strategies that branched oncapital_availableinon_shutdownsaw an overstated value (MAJOR-T) - Enforce
rolling_loss_24h/7d/30dlimits inevaluate_risk_breach—RiskStageLimitsgainsmax_rolling_loss_24h/7d/30dfields;RiskCheckMetricsextended with the rolling-loss values;to_risk_check_metricspopulates them. Wirestate_store.refresh_rolling_lossesintoHealthLoopvia optionalrolling_loss_refresherkwarg so 24h/7d/30d windows decay as old loss events age out. Pre-fix the fields were tracked, persisted via WAL codec, andrefresh_rolling_lossesexisted for decay but no validator stage read them andrefresh_rolling_losseshad zero production callers (MAJOR-H) - Pre-bind
OutcomeProcessor._positions_cmin__init__to either the lock ornullcontext()so_grow_positionand_reduce_positionuse a single readablewith self._positions_cm:line instead of an inline ternary (Greybeard pre-PR review) - Add 36 new tests across
test_action_submit.py(4 — release_reservation rollback variants),test_capital_controller.py(3 —TestSendOrderBoundaryRace+ 4 —TestReconcileAtBootResetsPendingExit+ 3 —TestOrderExitInvariants),test_health_loop.py(2 — refresher invoked + exception swallowed),test_outcome_processor.py(3 —TestPositionsLockHonoredByWriter),test_praxis_outbound.py(1 + 1 — strategy_id pass-through),test_shutdown_sequencer.py(4 — canceled/expired/submit-exit-increment + capital_available subtract + concurrent mutation),test_startup_sequencer.py(2 — un-importable position invariants),test_trade_command.py(5 — strategy_id field invariants),test_translate.py(3 — strategy_id propagation),test_validator_intake_stage.py(2 — INTAKE_EXIT_STRATEGY_MISMATCH),test_validator_risk_stage.py(5 — rolling-loss enforcement). Total Nexus tests: 1254 - Add
docs/TechnicalDebt.mdentries TD-042 through TD-051 — defer round-12/13/14 audit findings that are not paper-trade-fatal (MODIFY validator-bypass set,_clear_pending_exitclamp diagnostic,pending_exitdurability,_handle_ackfalse-positive WARN,_handle_cancelremaining_size=Noneover-clear,_handle_rejectEXIT-reject WARN,_handle_fillpost-success exception path,_purge_expiredperiodic invocation,bridge_to_capitalhelper unused by production launcher, realized_pnl exit-fee accounting)
v0.35.0 on 1st of May, 2026
- Add
max_allocation_per_trade_pct: Decimalkeyword-only argument toCapitalController.__init__— defaults to module constantMAX_ALLOCATION_PER_TRADE_PCT(Decimal('0.15')) so prior callers are unchanged. The per-trade allocation gate atcheck_and_reservenow reads the instance attribute, letting operators with higher-Kelly strategies raise the cap at construction without forking the controller. Constructor validates the kwarg is a finite, positiveDecimal(rejects non-Decimal, non-finiteNaN/±Infinity, zero, and negative values) - Add ten tests in
test_capital_controller.pyunderTestMaxAllocationPerTradePctOverridecovering default-matches-constant, higher-override-admits, lower-override-denies, denial-reason-carries-override, non-Decimal-raises, zero-raises, negative-raises, NaN-raises, Infinity-raises, negative-Infinity-raises
v0.36.0 on 1st of May, 2026
- Add
lookback: int = 1keyword-only argument toproduce_signal— default 1 preserves priortail(1)behaviour bit-for-bit;lookback=Nfeeds the last N prepared rows intosensor.predict. Caller-side validation raisesTypeErroron non-int /boolandValueErroron values < 1 - Fix dtype preservation in
_extract_values— multi-element-array branch previously castval[-1]tofloatunconditionally, demoting_predsfrominttofloatfor arrays of length > 1. Now the last element's dtype is preserved regardless of array length, and zero-length arrays are skipped instead of indexing into them - Add
TestLookbackclass (7 tests) and threeTestExtractValuestests intest_signal_producer.py; update existingtest_multi_element_array_takes_lastto assert int dtype
v0.37.0 on 1st of May, 2026
Add
- Add
CapitalController.recover_orphaned_order— defense-in-depth helper for FINAL-MAJOR-01 cross-repo: when the launcher'sprocess_outcomehits the no-OrderContext terminal cleanup branch, the helper releases the orphan order's capital aggregates (mirrorsorder_reject/order_cancelper-state release without requiringOrderContext). Idempotent. Position growth from FILL outcomes is intentionally NOT performed; aggregate release is the priority and the next boot's_reconcile_capitaladopts Praxis truth for position state. No production caller yet — Praxis follow-up tracked as TD-067 - Add
CapitalController.lock_cmreturning the internal_lockso callers likeShutdownSequencer._final_checkpointcan serialise reads ofstate.capital.per_strategy_deployedand the aggregate fields atomically with respect to in-flight controller mutations (FINAL-MAJOR-05) - Add
RiskState.lockdataclass field (init=False,repr=False,compare=False) andRiskState.lock_cmhelper that returns the lock as a context manager (ornullcontext()when unset) so the OutcomeProcessor writer, HealthLoop refresher, and validator reader coordinate on the same lock instance, consistent with thedataclasses.replace()behavior covered by tests (FINAL-MAJOR-02) - Add
derive_strategy_realized_pnlthat sums signed cumulativerealized_pnlper strategy from WAL events; called bystate_store.recover()so a crash betweenappend_eventandappend_mutationdoes not leavestrategy_realized_pnlpermanently understated and drawdown gates stale (FINAL-TD-01) - Add
_dedup_by_outcome_idfilter helper inloss_derivation.pyshared byderive_rolling_lossesandderive_strategy_realized_pnlso a Praxis re-delivery of an already-emitted terminal outcome does not double-count via duplicate STRATEGY_EVENT entries (FINAL-TD-02) - Add
outcome_id: str = ''field toStrategyEvent; WAL event codec bumped to v2 with the new field; v1 payloads decode tooutcome_id=''and are NOT deduped (legacy WAL contract). Versions are now named constants (_CODEC_VERSION_1,_CODEC_VERSION_LATEST,_EVENT_CODEC_VERSION_1,_EVENT_CODEC_VERSION_2,_EVENT_CODEC_VERSION_LATEST) - Add
_SUB_ULP_TOLERANCE = Decimal('1E-12')constant incapital_controller.pyshared byorder_exit(FINAL-MAJOR-06) andorder_fill(FINAL-MAJOR-09); absorbs sub-ULP rounding noise without weakening the underlying invariants - Add
_wal_locktoStateStorewrappingappend_mutation,append_event, ANDcheckpoint(snapshot+truncate) as one atomic critical section so concurrent writers from OutcomeLoop and shutdown thread cannot produce duplicate_sequencerecords or torn appends (FINAL-MAJOR-04) - Add
positions_lockparameter tosubmit_actionsso the EXITposition.pending_exit += ctx.order_sizewrite at line ~250 runs under the lock; closes the lost-update race with the OutcomeProcessor decrementer (FINAL-MAJOR-03) - Add
capital_controllerparameter toShutdownSequencer.__init__;_final_checkpointnow wraps the checkpoint call inpositions_lock + CapitalController.lock_cm()so a still-alive OutcomeLoop after_stop_outcome_loopjoin_timeout cannot race the snapshot serializer's iteration ofstate.positions,state.risk.per_strategy, orstate.capital.per_strategy_deployed(FINAL-MAJOR-05) - Add new test classes covering the FINAL-MAJOR-01..10 + FINAL-TD-01/02 fixes:
TestRecoverOrphanedOrder,TestFinalMajor02RiskLockCoverage,TestFinalMajor03PendingExitLockCoverage,TestFinalMajor04WalAppendAtomicity,TestFinalMajor05CheckpointLockCoverage,TestFinalMajor06ExitBoundaryTolerance,TestFinalMajor08RealizedPnlIsNetOfFees,TestFinalMajor09OrderFillAttributionLockstep,TestFinalMajor10RecoverDecaysRollingLossesEvenWithEmptyEvents,TestFinalTd01RecoverDerivesStrategyRealizedPnl,TestFinalTd02OutcomeIdDedup. The FINAL-MAJOR-06 sweep test exercises the full 200×19 = 3800-pair(notional, size)grid and asserts every triggering pair (>100 pairs) succeeds post-fix - Add 15 deferred-finding entries (TD-052..TD-066) to
docs/TechnicalDebt.md; subsequently pruned TD-052 and TD-053 (resolved by FINAL-TD-01 / FINAL-TD-02 within the same release) and corrected TD-057 / TD-058 / TD-066 closure-claims that overstated transitive closure by FINAL-MAJOR-02 - Add 4 pre-PR review TD entries (TD-067, TD-069, TD-070, TD-071) to
docs/TechnicalDebt.mdcovering the dead-code helper, empty-string sentinel, decoder duplication, and unlocked recover writes. TD-068 (dataclass-bypass attribute) was opened then resolved within this release by promotingRiskState.lockto a proper dataclass field
Fix
- Fix
state.risk.per_strategycross-thread access. Pre-fix the OutcomeLoop writer, HealthLoop refresher, validator'sto_risk_check_metricsreader, and the WAL serializer iterated/mutated the dict without coordination — a fresh-strategy insert during property iteration raisedRuntimeError: dictionary changed size during iteration, silently swallowed by HealthLoop and breaking rolling-loss decay. Post-fix all four call sites coordinate onstate.risk.lock(FINAL-MAJOR-02) - Fix
position.pending_exit +=lost-update race on both shutdown EXIT (ShutdownSequencer._submit_exit) and runtime EXIT submit paths (submit_actions). The OutcomeProcessor decrementer (_reduce_position/_clear_pending_exit) reads, modifies, and writes the same field — concurrent writers could lose the update via torn read-modify-write and undermine the validator'sINTAKE_EXIT_SIZE_EXCEEDS_REMAININGdefense within the same tick (FINAL-MAJOR-03) - Fix WAL append atomicity. Pre-fix
_sequence += 1(a 2-bytecode read-modify-write) andWAL.append(open +_find_valid_end+ truncate + write + fsync — a TOCTOU on file size) were unprotected. Concurrent appenders from OutcomeLoop and shutdown thread could produce duplicate sequence numbers and torn appends.checkpointnow also runs under the same lock so snapshot+truncate is atomic with appends (FINAL-MAJOR-04) - Fix
_final_checkpointserializer iteration race on shutdown thread. Pre-fixserialize_stateiteratedstate.positions,state.risk.per_strategy,state.capital.per_strategy_deployed, and readCapitalStateaggregates without any lock — a still-alive OutcomeLoop worker after_stop_outcome_loopjoin_timeout could triggerRuntimeError: dictionary changed size during iterationand lose the persisted shutdown HALTED mode. Post-fix wraps the call inpositions_lock + CapitalController.lock_cm()(FINAL-MAJOR-05) - Fix
order_exitstrict>boundary trip on sub-ULP overshoots from_compute_exit_cost_basis's(N/q) * qround-trip. Verified single-fill repro(q=Decimal('3'), N=Decimal('5'))produces5.000...001 > 5at default Decimal precision; pre-fix returnedINVARIANT_BREACHand silently dropped the EXIT FILL on the capital side. Post-fix uses_SUB_ULP_TOLERANCE(1E-12 quote) on the comparison and clamps the actual aggregate decrement viamin()soposition_notionalandper_strategy_deployednever go negative (FINAL-MAJOR-06) - Fix
_reduce_positionto subtractoutcome.actual_feesfromrealized_pnl. Pre-fix returned GROSS realized_pnl that flowed verbatim intostrategy_realized_pnl,cumulative_realized_pnl, equity, equity_hwm, and the rolling-loss windows; rolling-loss / drawdown gates fired LATER than they should by the cumulative fee total. On testnetfee_rate=0so unobserved at MMVP today; mainnet-fatal oncefee_rateflips non-zero. Post-fix the entire risk derivation chain reflects NET PnL (FINAL-MAJOR-08) - Harden
order_fillfee-deficit check against sub-ULP precision drift betweenproportional_estimated(computed via subtraction round-trip) andactual_fees(computed via direct division). On awkward notional/fee ratios (e.g. notional=7, fee=1) the deficit can accumulate sub-ULP and tripEXPECTED_MISScosmetically. Post-fix uses_SUB_ULP_TOLERANCEon the deficit check; real deficits (>1E-12 quote) still hard-fail. NOTE: the audit finding labeled FINAL-MAJOR-09 (cumulative attribution drift viapre_fill_remaining - updated.remaining_totalfeedingworking_order_notional/per_strategy_deployed) was empirically disproven at default Decimal precision (the round-trip subtraction has cancellation properties that keep attribution in lockstep with total_deployed across realistic multi-partial scale-ins; the strict equality denial does not fire). The actual reachable failure mode the audit's R17-C MAJOR-ND analysis pointed at is theorder_exitboundary trip closed by FINAL-MAJOR-06's_EXIT_BOUNDARY_TOLERANCEclamp.TestFinalMajor09OrderFillAttributionLockstepPINS the empirical lockstep so a future arithmetic refactor cannot regress it (FINAL-MAJOR-09) - Fix
state_store.recover()to always re-deriverolling_loss_*against current time — pre-fix early-returned when WAL had zero events, leaving snapshot's stalerolling_loss_*for the validator to read for ~5s after boot before HealthLoop's first refresh. Combined with FINAL-MAJOR-02 (where a silent dict-resize race could fail the first refresh), the staleness extended indefinitely (FINAL-MAJOR-10) - Fix
state_store.recover()to also re-derivestrategy_realized_pnl,cumulative_realized_pnl, andhigh_water_markfrom STRATEGY_EVENT entries — pre-fix onlyrolling_loss_*was re-derived; on a crash betweenappend_eventandappend_mutationthe per-strategy realized PnL delta from the lost STATE_MUTATION was permanently dropped, leaving drawdown gates LATER than they should by the missing delta (FINAL-TD-01) - Fix
derive_rolling_lossesandderive_strategy_realized_pnlto deduplicate events byoutcome_id— pre-fix a Praxis re-delivery of a terminal outcome that was already emitted pre-crash would produce duplicate STRATEGY_EVENT entries and double-count rolling losses. Emptyoutcome_id(legacy v1-codec events) is NOT deduped — preserves the legacy WAL contract (FINAL-TD-02)
Update
- Update
CapitalController.order_exitdocstring to reflect the new net-of-feerealized_pnlsemantics: exit fees ARE deducted fromrealized_pnlat the source in_reduce_position, sostrategy_realized_pnl,cumulative_realized_pnl, equity, and rolling-loss windows all reflect NET PnL - Update
docs/TechnicalDebt.mdto reflect actual deferred status of TD-057, TD-058, TD-066 — initial entries claimed transitive closure by FINAL-MAJOR-02, but the M02 implementation scopedstate.risk.lockto the risk dict only and did not extendpositions_lockcoverage to the cited call sites - Update
pyproject.tomlversion0.36.0→0.37.0
v0.38.0 on 3rd of May, 2026
Add
- Add
_processed_outcome_idsset +_dedup_locktoOutcomeProcessor;process(outcome, context)returns success no-op on a repeatedoutcome.outcome_idso Praxis's planned delivery retry / boot replay-from-spine paths cannot double-mutate capital or position state. In-memory dedup; cross-restart safety lives on the Praxis side viaOutcomeAckedfiltering at boot (round-18 MAJOR-004) - Add 4 deferred-finding entries (TD-083, TD-084, TD-085, TD-086) to
docs/TechnicalDebt.mdcovering theOutcomeProcessordedup lock TOCTOU contract and the unbounded_processed_outcome_idsset growth surfaced during pre-PR review, thesubmit_actionsvalidator-exception leak path raised in PR #57 review, and the dedup-after-mutation defect in_handle_fill(capital/position mutated beforeappend_event; a raise leaves the dedup set empty so a retry double-mutates) raised by Copilot in PR #57 review - Add 7 round-18 audit deferred-finding entries (TD-076..TD-082) to
docs/TechnicalDebt.mdcovering: missing end-to-end rolling-loss enforcement test (TD-076); persisted HALTED mode overwritten by HealthLoop after restart (TD-077); boot reconciliation keeps staleavg_cost_basis(TD-078); no architectural guard against directPraxisOutbound.send_commandcallers (TD-079); shutdown does not guarantee_final_checkpointif an earlier step raises (TD-080);_persist_strategy_stateand_final_checkpointblock on disk fsync without timeout (TD-081); validator'splatform_limits_stagelacks Binance symbol-filter checks (TD-082) - Add new test classes covering the round-18 fixes:
TestOutcomeIdIdempotency(round-18 MAJOR-004 part A — dedup happy path, double-mutation guard, failed-attempt does not poison dedup, dedup is per-outcome_id not per-command_id); 2 new tests appended toTestRecoverOrphanedOrder(round-18 MAJOR-003 — explicit double-call idempotency, capital restored for new reservation after orphan release);TestReleaseReservationOnLateValidatorDeny(round-18 MAJOR-006 — HEALTH/PLATFORM_LIMITS deny after CAPITAL grant releases reservation, pre-CAPITAL deny does not call release, ABORT bypasses validator)
Fix
- Fix
submit_actionsREJECTED branch leaking the grantedReservationwhen a post-CAPITAL validator stage (HEALTH or PLATFORM_LIMITS) denies the action. Validator stage order isINTAKE → RISK → PRICE → CAPITAL → HEALTH → PLATFORM_LIMITS;Pipeline.validatere-attaches the granted reservation to the denied decision so the caller can release. Pre-fix the REJECTED branch returned without calling_release_granted_reservation, leaving the reservation parked in_reservationsuntil 30s TTL eviction. Repeated late-stage denies (e.g., spread limit on a degraded venue, headroom failure during sustained rate-limit pressure) starved available capital. Helper docstring expanded to document the third call site alongside the existing translate / send_command exception sites (round-18 MAJOR-006)
v0.39.0 on 4th of May, 2026
Add
- Add
examples/strategies/logreg_binary_evsfd.py— primitive long-onlyStrategydriven by a binary classifier signal: ENTER on_preds == 1, EXIT on_preds == 0, single concurrent position. MARKET orders viaExecutionMode.SINGLE_SHOT, 10% capital fraction per ENTER, 60s execution deadline. All other lifecycle hooks are no-ops. Reference price is read fromsignal.get('close'); the strategy returns no action when the signal payload lacks a price or the price is not finite-positive._predspayloads are validated as int 0/1 (no float floor, no bool→int coercion); invalid payloads are logged at WARNING and skipped (issue #33) - Add
examples/logreg_binary_evsfd.yaml— operator-deployable manifest pinning a single sensor atpermutation_ids: [21]from aBtcLogRegEVSFD5000-permutation Limen run withinterval_seconds: 7200andcapital_pct: 100. Manifest references the strategy file asstrategies/logreg_binary_evsfd.py(relative to the manifest's parent directory, whichload_manifestvalidates against). Placeholderaccount_id,allocated_capital,capital_pool, andsensors[].experimentpath for operator substitution at deploy time - Add
examples/README.md— deploy guide for the example bundle: prerequisites for the upstream Limen experiment directory (metadata.json,round_data.jsonl,results.csv), theexperiment_dir=+search_strategy=constructor requirement onUniversalExperimentLoop, the importable-SFD-module requirement (metadata.json[sfd_module]is reloaded byTrainerviaimportlib.import_module()so the SFD class must not live in__main__), and the 3-step deploy procedure for the launcher'sMANIFESTS_DIRandSTRATEGIES_BASE_PATH
v0.40.0 on 5th of May, 2026
Add
- Add
tests/test_limen_trainer_contract.py— 10 tests pinning the LimenTrainerintegration contract Nexus depends on.TestTrainerInitContract: parameter names,experiment_diris required + accepts positional,datadefaults to None + accepts keyword.TestTrainerTrainContract: parameter names,permutation_idsaccepts positional, return type viatyping.get_type_hints(robust tofrom __future__ import annotations).TestTrainerPrivateAttributeContract:Trainer.__init__source containsself._dataandself._manifestassignments — pins the private-attribute reads atnexus/startup/sequencer.py:634, 655. A futurevaquum_limenbump that reshapes any of these now fails CI loudly instead of breaking at deploy time
Update
- Bump
vaquum_limengit+https pin fromv2.4.3tov3.0.1. Limen v3 introduced a Manifest API rename (RFC-1004) and a class-basedlimen.targetsmodule replacing the v2 function-based target builders; Nexus production code only importsfrom limen.experiment.trainer.trainer import Trainer(nexus/startup/sequencer.py:15), and theTrainer.__init__(experiment_dir, data=None)+Trainer.train(permutation_ids: list[int])signatures are unchanged in v3.0.1, so no Nexus code change is required. SFD modules feeding the Trainer (e.g. theBtcLogRegEVSFDexample) must be re-trained against v3 limen viaexperiment_runnerbefore deploy; the bundle re-train is upstream and decoupled from this pin bump - Update
vaquum_limen 2.4.3→vaquum_limen 3.0.1in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v3.0.1Trainerclass (verified viainspect.getsource(Trainer.__init__)) so the re-validate-on-upgrade contract is satisfied
v0.41.0 on 6th of May, 2026
Add
- Add
PredictLoop.tick_once(wired)— synchronous single-shot entry point for schedule-driven callers (e.g. a deterministic backtest replay). Runs one predict cycle (market_data fetch →produce_signal→dispatch_signal→ optionalaction_submit) without requiringstart()and without scheduling a follow-upthreading.Timer. The_runningguard takes_lockso the check is atomic withstart()/stop()(and raisesRuntimeErrorwhen the Timer-driven loop is active); the chain body runs without the lock, so callers must not invokestart()mid-tick. Propagates exceptions from the chain to the caller instead of swallowing them as_tickdoes — schedule drivers decide how to handle failures rather than relying on a worker log. Mirrors thetick_once()shape already exposed byOutcomeLoopandHealthLoop. Pure addition: no existing line inpredict_loop.pywas modified, all 9 existingtest_predict_loop.pytests still pass, and Timer-driven production callers (Praxis runtime) see no behaviour change - Add
tests/test_predict_loop_tick_once.py— 14 tests covering: synchronous dispatch withoutstart(), no follow-up Timer scheduling,RuntimeErrorguard against concurrent Timer-loop use, empty-market-data short-circuit, action_submit forwarding (called/not-called/exception-propagated branches), exception propagation from market_data_provider and dispatch_signal, repeated independent calls, runtime call ordering, a static-source drift sentinel (test_chain_markers_present_and_ordered_in_both_paths) that asserts both_tickandtick_onceinvoke the chain steps_extract_kline_size→_market_data_provider→produce_signal→_context_provider→dispatch_signal→_action_submitin that order viainspect.getsource, and a real runtime parity test (test_chain_invoked_in_same_order_as_tick) that drives both_tick(with_runningflipped manually and_schedule_lockedpatched to a no-op so it does not reschedule) andtick_onceagainst identical tracking providers, asserting their recorded event lists match byte-for-byte
v0.42.0 on 6th of May, 2026
Update
- Bump
vaquum_limengit+https pin fromv3.0.1tov3.0.3. Limen v3.0.3 (Vaquum/Limen#500) makesTrainer.__init__hermetic per-experiment: the SFD module named bymetadata.json["sfd_module"]is now loaded by preferring a<sfd_module>.pyfile insideexperiment_dir(viaimportlib.util.spec_from_file_location+module_from_spec, nosys.pathmutation) before falling back toimportlib.import_module. Nexus production code only importsfrom limen.experiment.trainer.trainer import Trainer(nexus/startup/sequencer.py:15), and the publicTrainer.__init__(experiment_dir, data=None)+Trainer.train(permutation_ids: list[int])signatures are unchanged in v3.0.3 (verified bytests/test_limen_trainer_contract.py— all 10 contract tests pass against v3.0.3 unmodified). Unblocks the Praxis paper-tradeBtcLogRegEVSFDdeploy where the SFD.pyproduced bytrainer_prep.pylives inside the stagedexperiment_dirbut is referenced by a bare module name inmetadata.json— under v3.0.1 this path raisedModuleNotFoundErrorbecause the experiment_dir was not onsys.path; under v3.0.3 the local-file branch loads it directly with no operator-sidePYTHONPATHwiring required - Update
examples/README.mdSFD-module guidance to describe Limen v3.0.3's two-stage load (local<sfd_module>.pyinsideexperiment_diris now the preferred path; PYTHONPATH-importable module remains supported as the fallback). Pre-v3.0.3 the README only described the PYTHONPATH path, which would mislead operators ofBtcLogRegEVSFD-style experiment_dir bundles into unnecessary deploy-timePYTHONPATHwiring - Update
vaquum_limen 3.0.1→vaquum_limen 3.0.3in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v3.0.3Trainerclass (verified viainspect.getsource(Trainer.__init__)) so the re-validate-on-upgrade contract is satisfied
v0.43.0 on 7th of May, 2026
Update
- Bump
vaquum_limengit+https pin fromv3.0.3tov3.0.5(Vaquum/Limen#505). Limen v3.0.5 fixes the experiment-local SFD load to register the loaded module insys.modules(with rollback onexec_modulefailure) so downstreamimportlib.import_module(architecture_function.__module__)lookups (notably Limen's ownTrainer._resolve_model_class) resolve to the same module instance. Without this, self-contained bundles (e.g.BtcLogRegEVSFD-style experiment_dirs whose architecture function is defined inside the SFD file) reachedTrainer.__init__cleanly but failed attrain()→_resolve_model_class()withModuleNotFoundError. Nexus production code only importsfrom limen.experiment.trainer.trainer import Trainer(nexus/startup/sequencer.py:15); the publicTrainer.__init__(experiment_dir, data=None)+Trainer.train(permutation_ids: list[int])signatures are unchanged in v3.0.5 (verified bytests/test_limen_trainer_contract.py— all 10 contract tests pass against v3.0.5 unmodified). Unblocks the Praxis paper-tradeBtcLogRegEVSFDdeploy at the_resolve_model_classpath; the cp-to-manifests/operator workaround introduced in the v0.42.0 deploy is no longer required - Update
vaquum_limen 3.0.3→vaquum_limen 3.0.5in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v3.0.5Trainerclass so the re-validate-on-upgrade contract is satisfied
v0.44.0 on 9th of May, 2026
Fix
- Fix
produce_signalto pass the lastlookbackrows tosensor.predictas apolars.DataFrameinstead ofnumpy.ndarray. Previouslysignal_producer.pycalledx_train.tail(lookback).to_numpy()which discarded column names. SFDs that defend against feature-shape drift by selecting_model_columnsfrom the live frame at predict time (e.g. theBtcLogRegEVSFDbundle, which recordsself.model_colsat fit time and callsframe.select(self.model_cols)in_raw_probs) then fell into a brittle index-based fallback that crashed when the predict-time frame had columns the training-time frame did not. Specifically: HF dataset training produces 17 input columns, binancial trade-aggregation live-fetch produces 19 (extra:median,iqr); after the bundle's feature pipeline this lands as 80 predict-time x_train columns vs 78 at training, and the SFD's numpy-branch shape checkx.shape[1] == len(self.training_feature_columns)(80 != 78) skipped the index-based slice and forwarded all 80 columns toLogisticRegression.predict_probawhich expected 77, raisingValueError: X has 80 features, but LogisticRegression is expecting 77 features as inputon every sensor tick. Passing the polars DataFrame keeps column names intact so the SFD'spl.DataFramebranch (x = _frame_to_numpy(frame, self.model_cols)) selects the trained 77 columns by name and ignores extras, which is the contract_model_columnswas designed for. TheSensor.predictcallers downstream ofproduce_signalalready accept polars DataFrames at training time (the Limen reference architectures'evaluate(...)paths feeddata['x_test']aspl.DataFramefromprepare_data), so the change harmonises the live and training paths on the same input shape
Add
- Add
tests/test_signal_producer.py::test_predict_receives_polars_dataframe_preserving_column_names— pins the Sensor.predict input contract:data['x_test']must arrive as apolars.DataFramewith the actual training-feature column names intact, not anumpy.ndarrayand not a polars reconstruction with defaultcolumn_<i>labels. Capturestype(data['x_test'])and the full column list inside a wrapper aroundwired.sensor.predictand asserts (1) the type ispl.DataFrame, (2) at least one column is present, (3) no column name starts withcolumn_(polars' default for unnamed columns — a regression likepl.DataFrame(x_train.tail(...).to_numpy())would silently strip real names while still passing a naive type+count check), and (4) the captured column list matchesmanifest.with_params_override(split_config=(1,0,0)).prepare_data(market_data, round_params)['x_train'].columnsexactly (pins that the captured frame is the actual one passed through, not a reconstructed one). Defends the fix against future re-introduction ofto_numpy()or any other column-name-stripping transform in the predict path
v0.45.0 on 10th of May, 2026
Update
- Bump
vaquum_limengit+https pin fromv3.0.5tov3.0.6(Vaquum/Limen#507). Limen v3.0.6 addsend_date_limitandrow_count_limit(canonical name; legacyn_rowsretained as alias) parameters toHistoricalData.get_spot_klinesandHistoricalData.get_any_file. With bothstart_date_limitandend_date_limitset the data window is fully closed and reproducible across daily HF dataset snapshot growth — unblocks Praxis paper-trade deploys whereTrainer.train()'s Pass 1 strict reconstruction check refits with whateverlatest.jsonresolves to at run time, and pre-3.0.6 the daily HF snapshot drift madebars_total/backtest_*metrics deviate from the storedresults.csv(manifest had onlystart_date_limit, so the window grew with the dataset), trippingReconstructionErrorat sensor-wiring time. Nexus production code only importsfrom limen.experiment.trainer.trainer import Trainer(nexus/startup/sequencer.py:15); the publicTrainer.__init__(experiment_dir, data=None)+Trainer.train(permutation_ids: list[int])signatures are unchanged in v3.0.6 (verified bytests/test_limen_trainer_contract.py— all 10 contract tests pass against v3.0.6 unmodified). Theend_date_limit/row_count_limitparameters land on theHistoricalDatadata-source method, not onTrainerdirectly, so SFDs adopt them by settingset_data_source(method=HistoricalData.get_spot_klines, params={..., 'end_date_limit': '<date>'})in theirmanifest() - Update
vaquum_limen 3.0.5→vaquum_limen 3.0.6in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v3.0.6Trainerclass so the re-validate-on-upgrade contract is satisfied
v0.46.0 on 10th of May, 2026
Fix
- Fix
produce_signalto supportRuleBasedManifestSFDs alongsideMLManifest. Previously the predict path was hard-coded against theMLManifest.prepare_dataoutput shape —data_dict.get('x_train')for the live train frame andwired.sensor.predict({'x_test': ...})for the predict call.RuleBasedManifest.prepare_datareturns a different shape:{'train', 'val', 'test', '_alignment', 'strategy'}with nox_train/x_testkeys (perlimen/experiment/manifest_core.py'sRuleBasedManifest.prepare_data→_finalize_rule_based_data→split_data_to_rule_based_prep_output), so every rule-based sensor tick raisedValueError: prepare_data returned no x_train for sensor <id>on the empty-train guard, breaking the predict loop for the entire rule-based-SFD class. Post-fix,produce_signalbranches onisinstance(wired.limen_manifest, RuleBasedManifest)and pullstrain/ passestestfor that path. ML-SFDs are unaffected — they keep usingx_train/x_test. Surfaced when the operator manifest YAML staged aRuleBasedManifest-backed stub-strategy bundle alongside the existingBtcLogRegEVSFD(MLManifest) bundle and four sensors crashlooped on the empty-train guard while the ML one ticked cleanly
Add
- Add
tests/test_signal_producer.py::test_predict_called_with_test_key_for_rule_based_manifestand the_make_wired_rule_based_sensorfixture that drives the foundationallimen.sfd.foundational_sfd.rule_basedSFD throughTrainer.train([1])to produce aWiredSensorwhoselimen_manifestis a realRuleBasedManifest. The test wrapswired.sensor.predictwith a key-capturing shim, runsproduce_signal, and asserts (1) the captureddatadict contains key'test'(the rule-based contract) and (2) does NOT contain'x_test'— the negative assertion guards against a regression that would silently fall back to the ML key and crash inside the rule-based reference architecture'spredict(data)which readsdata['test']. Pinning both halves keeps the manifest-type branching honest
v0.47.0 on 13th of May, 2026
- Fix
configure_loggingto addstructlog.stdlib.ExtraAdder()toProcessorFormatter.foreign_pre_chainso stdlib_log.info('msg', extra={...})payloads survive into JSON output instead of being silently dropped (mirrors Vaquum/Praxis#105) - Add
bound_context(**kwargs)context manager tonexus/infrastructure/observability.pywrappingstructlog.contextvars.bound_contextvars - Wrap
submit_actionsper-iteration body inwith bound_context(strategy_id, action_type, trade_id?, command_id?)so downstream emits carry per-action correlation via contextvars - Add
test_stdlib_extras_appear_in_json,test_bound_context_binds_and_unbinds,test_bound_context_resets_on_exceptionintests/test_observability.py; addTestPerActionBoundContext(4 cases) intests/test_action_submit.py
v0.48.0 on 17th of May, 2026
- Add INFO-level
signal producedlog innexus/strategy/predict_loop.pyimmediately after everyproduce_signal()call intick_onceand_tick, BEFORE the strategy runner dispatches the signal. Capturesstrategy_id,sensor_id,predictor_fn_id, andvaluesso operators can see the predictor's actual output on every tick — without this a HOLD-only strategy (every prediction maps to no-action) is indistinguishable from a broken predict path because the strategy itself logs nothing on HOLD. Production-motivated: a logreg sensor in Praxis ran for 22h with zero commands and there was no way to tell from logs whether the model was predicting 0 or the predict path was silently broken - Add
_values_for_loghelper that coerces every entry to a JSON-safe form for the configured orjson renderer (nodefault=callback, noOPT_SERIALIZE_NUMPYflag) so the structured log line cannot drop.Decimal→str;numpy.generic→ native via.item();numpy.ndarray/polars.Series→.tolist()if size ≤ 16, else summary string<sequence type=X size=N>; any other__len__-bearing object over the threshold →<sequence type=X len=N>; any remaining non-JSON-native value →repr(val) - Pin behaviors in
tests/test_predict_loop_tick_once.py:test_logs_signal_before_dispatchasserts the log record carries the expected extras AND was emitted beforedispatch_signalran (ordering pinned viadispatch_signalside-effect snapshot);test_values_for_log_passes_native_primitives_through,test_values_for_log_coerces_json_unsafe_types,test_values_for_log_summarizes_long_series_and_ndarrays,test_values_for_log_truncates_long_sequences, andtest_values_for_log_output_is_orjson_serializablecover every coerced type and round-trip the helper's output throughorjson.dumps
v0.49.0 on 21st of May, 2026
- Add
_inject_reference_priceshim innexus/strategy/signal_producer.pythat, afterpredict()returns, forwards the latest rawclosefrom the pre-feature-engineeringmarket_dataframe into theSignal.valuesdict when the predictor didn't includecloseitself. ML pipelines that runclosethroughfractional_diff(or any other column-replacing transform inprepare_data) cannot recover the raw price from insidepredict(); rule-based / stub predictors that forwardclosedirectly are unaffected (existing values are never overwritten). Closes the silent-no-op failure mode where strategies keying onsignal.get('close')for ENTER notional sizing produced zero commands despite firing_preds=1predictions every tick - Add
TestInjectReferencePricetest class intests/test_signal_producer.pywith 10 cases:closeinjected when absent, predictor-suppliedclosepreserved verbatim, emptymarket_datais a silent no-op, missingclosecolumn is a silent no-op, non-numericclosevalue is a silent no-op, NaNcloserejected at the boundary, +Infinity rejected, -Infinity rejected, Pythonboolclose rejected,numpy.bool_close rejected - Reject non-finite
close(NaN / +/-Infinity) at the injection boundary in_inject_reference_price;float(polars_nan)returnsmath.nanwithout raising, so without themath.isfinite()guard the non-finite value would reachSignal.__post_init__(nexus/strategy/signal.py:45-46) which raisesValueError: values['close'] must be finiteand crashes the predict-loop tick. The boundary guard converts the crash into a silent skip consistent with the shim's fail-silent contract on every other guard path. Mirrors the Nexus-wide validation_finiteness pattern of rejecting at the boundary - Reject
boolandnumpy.bool_closevalues before the float cast in_inject_reference_price;float(True) == 1.0/float(False) == 0.0are both finite and would slip pastmath.isfinite, injecting a bogus 0/1 reference price. Matches the canonical Nexus bool-exclusion pattern (isinstance(val, bool)— seehealth_evaluator.py:42,:52,:105,:111). Polars scalar access can return either Pythonboolornp.bool_depending on dtype, so both are checked explicitly (np.bool_ is not aboolsubclass)
v0.50.0 on 23rd of May, 2026
Update
- Bump
vaquum_limengit+https pin fromv3.0.6tov3.9.0(Vaquum/Limen@v3.9.0). Limen v3.9.0 ships the new YAML-based SFD pipeline (limen/yaml/package —parser,compiler,resolver,validator,rules) that unblocks experiment_runner bundles declaringmetadata.json["sfd_module"] = "yaml:<name>"with amanifest.ymlinstead of a<sfd_module>.pypredictor file. The LimenTrainerAPI surface that Nexus depends on is unchanged across the v3.0.6 → v3.9.0 jump:Trainer.__init__(experiment_dir, data=None),Trainer.train(permutation_ids: list[int]), the private_data/_manifestattribute reads innexus/startup/sequencer.py(lines 634, 650-651 — flagged by# NOTEcomments) all still exist;RuleBasedManifestis still re-exported fromlimen.experiment(limen/experiment/__init__.py) and still extends the sameManifestbase withwith_params_override(...)/prepare_data(...)shape consumed byproduce_signal. 1385 Nexus tests pass and 17 are skipped against Limen v3.9.0 unmodified — including the 10test_limen_trainer_contract.pycases that pin theTrainerpublic contract and the rule-based / ML-manifest branch tests intest_signal_producer.py; the onePytestUnhandledThreadExceptionWarningintest_outcome_processor.py::TestFinalMajor08RealizedPnlIsNetOfFees::test_winning_exit_realized_pnl_is_net_of_fees(worker threadFileNotFoundErroron WAL teardown) is pre-existing test-cleanup race noise unrelated to the Limen pin. Nexus production code is not modified by this bump - Update
vaquum_limen 3.0.6→vaquum_limen 3.9.0in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v3.9.0Trainerclass so the re-validate-on-upgrade contract is satisfied (mirrors the precedent set in v0.45.0 when the prior 3.0.5 → 3.0.6 bump performed the same comment refresh) - Add transitive runtime dependency on
ruamel.yaml>=0.18via Limen v3.9.0 (limen/yaml/parser.py:4importsfrom ruamel.yaml import YAML). Picked up automatically through Limen'spyproject.tomldependency list — Nexus does not importruamel.yamldirectly, but loading anyyaml:-prefixed SFD bundle triggers the import chain throughlimen.yaml. Other Limen v3.9 deps (scikit-learn>=1.6.1,numpy>=2.2.6,pandas>=2.3.1,xgboost,lightgbm,tslearn,pyarrow,ta-lib,click>=8.0,scipy,statsmodels) are training-only and already in the broader Vaquum environment viabinancialand Praxis'sdevextras — no Nexus runtime addition beyondruamel.yaml
v0.51.0 on 24th of May, 2026
Update
- Bump
vaquum_limengit+https pin fromv3.9.0tov4.0.1(Vaquum/Limen@v4.0.1). v0.50.0 pinnedv3.9.0, but that tag'sTrainercannot reconstruct a YAML-based SFD bundle:Trainer.__init__passesmetadata.json["sfd_module"](which for a YAML SFD is theCompiledSFD.__name__literal"yaml:<name>") straight to_load_sfd_module, where theseg.isidentifier()path-traversal guard rejects the:and raisesValueError: sfd_module name 'yaml:...' is not a dotted sequence of valid Python identifiers. The YAML-reconstruction branch —Trainer.__init__detectingmetadata.json["yaml_reference"]and rebuilding the SFD viaCompiledSFD(yaml_reference)instead of_load_sfd_module— only landed in Limen v3.9.2 (commits7775f9a/f37eb74/e6ce7eb, PRs Vaquum/Limen#537-538), tagged after v0.50.0's pin was chosen. Verified locally: a real experiment_runner bundle (btc_logreg_15m_up_early,limen_version: "3.9.2", 500 rounds) raises the identifierValueErrorunder v3.9.0 and loads cleanly under v4.0.1 (Trainerinit OK,MLManifestreconstructed, round 24 with 34 populated params) - Go to
v4.0.1(latest) rather than the minimalv3.9.2fix. The only breaking change in thev3.9.2 → v4.0.1span isUniversalExperimentLoop.run()defaulting to skip terminal post-processing (Limen v4.0.0) — that is the training loop, which Nexus never calls; Nexus only consumes already-trained bundles throughTrainer. The consumption API surface Nexus depends on is signature-identical acrossv3.9.2 → v4.0.1(git diffontrainer.py/historical_data.py/manifest_core.py/experiment/__init__.pyshows no signature changes toTrainer.__init__/train/RuleBasedManifest/with_params_override/prepare_data— function bodies may differ where v4.0.x touched UEL internals, but the surface Nexus calls is unchanged), and the YAML schemaVERSIONis still'1.0', so a v3.9.2-produced bundle loads under v4.0.1. 1385 Nexus tests pass and 17 are skipped against Limen v4.0.1 unmodified — including the 10test_limen_trainer_contract.pycases that pin theTrainerpublic contract; the lonePytestUnhandledThreadExceptionWarningintest_outcome_processor.py(WAL-teardown race) is the same pre-existing test-cleanup noise unrelated to the pin. Nexus production code is not modified by this bump - Update
vaquum_limen 3.9.0→vaquum_limen 4.0.1in twonexus/startup/sequencer.pycomments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data,trainer._manifest); both private attributes still exist on the Limen v4.0.1Trainerclass so the re-validate-on-upgrade contract is satisfied (mirrors the comment-refresh precedent from v0.45.0 / v0.50.0)
v0.52.0 on 26th of May, 2026
Add
- Add
nexus/startup/sensor_cache.pyhousing the disk-cache and process-pool helpers for sensor reconstruction:bundle_id_for(SHA-256 over a bundle'smetadata.json+manifest.yml, first 16 hex chars — auto-invalidates whenlimen_version/data window change; hashes only the files that exist),cache_path_for(<cache_dir>/<bundle_id>/<permutation_id>.pkl),write_sensor_atomic(temp-file +Path.replaceso a reader never sees a partial pickle),default_max_workers(NEXUS_WIRE_MAX_WORKERS, default1= serial/inline; setN > 1to opt intoN-process parallelism), and theProcessPoolExecutorworker surface (init_workerloading each dir's frozen_datainto a worker-global dict once per worker,reconstruct_sensorbuildingTrainer(dir, data=…).train([perm])and returningsensors[0]orNonewhentrain()yields no Sensor) - Add process-parallel reconstruction to
_wire_sensors: the manifest is flattened into one_SensorWiringTaskper(strategy, experiment_dir, permutation_id); one loaderTrainer(dir)is constructed per unique resolved dir in the parent to obtain its_manifest(reused for everyWiredSensorfrom that dir — never crosses the process boundary) and frozen_data; cache misses fan out acrossProcessPoolExecutorseeded via the poolinitializer(the ~160MB_datais passed once per worker, never per task), with only the ~16KB picklableSensorcrossing back. GIL-boundtrain()gains nothing from threads (measured 1.03x on 8 perms), so real cores are used instead - Add an opt-in reconstruct-once disk cache (active only when
NEXUS_SENSOR_CACHE_DIRis set; unset preserves current behavior): on boot a cache HIT unpickles the storedSensorand skips reconstruction entirely; a MISS reconstructs and persists atomically; a corrupt/unreadable cache file is logged and treated as a MISS. Even an all-hit boot still constructs one loaderTrainer(dir)per unique dir for theWiredSensor.limen_manifest(seconds), but skips the per-perm sklearn fits (the expensive part) - Add the inline-reconstruction path selected when
_sensor_wire_max_workers <= 1— the default, so wiring is unchanged unless parallelism is opted into viaNEXUS_WIRE_MAX_WORKERS=N: misses reconstruct in the current process with noProcessPoolExecutor, so aTrainerpatched in the parent (as the test suite does) applies in-process — a pooled worker would re-import the module and never see the parent's patch - Deduplicate misses by
(experiment_dir, permutation_id)inside_reconstruct_missesbefore dispatching to the inline or pooled path, so a permutation referenced by more than one strategy is reconstructed exactly once instead of once per referencing task; the per-task wiring loop then wires that singleSensorto every referencing task, producing oneWiredSensorper strategy. Matches the perm-scoped (strategy-agnostic) disk-cache key, which already deduplicates across strategies - Add
tests/test_wire_sensors_disk_cache.py(7 cases) pinning the cache contract via the inline path with a patched in-processTrainer: HIT skips reconstruction, MISS reconstructs and writes the pkl, corrupt cache falls back without crashing, distinctmetadata.jsonyields distinctbundle_id, cache OFF never touches disk, andmanifest.ymlparticipates in thebundle_id
Update
- Update
tests/test_wire_sensors_data_cache.pyto assert the new fetch-once invariant (exactly one loaderTrainer(dir)per uniqueexperiment_dirwithoutdata=, then onedata=-bearing reconstruction per sensor) instead of the old chained-cache pattern (first ctor withoutdata=, subsequent withdata=cached._data); both encode the same PT-FIX-9 intent — the bundle data is fetched exactly once per uniqueexperiment_dirand every sensor reconstructs from that one frozen slice — and the tests set_sensor_wire_max_workers = 1so the patchedTrainerapplies in-process - Update
tests/test_wire_sensors_isolation.pyandtests/test_wire_sensors.pyandtests/test_startup_sequencer.pyto force the inline path (_sensor_wire_max_workers = 1) so their existingTrainer-mock assertions run in-process; the PT-FIX-18 isolation guarantee (per-sensor failure logged with full context and skipped; all-failed →StartupErrorwith the unchanged'all N sensor specs produced no wired sensors (R raised, E returned no Sensors)'message shape) is preserved, now accounted per-permutation rather than per-spec
v0.52.1 on 27th of May, 2026
BREAKING
_wire_sensorsinnexus/startup/sequencer.pyno longer runs aProcessPoolExecutor; it reconstructs cache misses inline only.NEXUS_WIRE_MAX_WORKERSno longer affects the launcher — it now governs the standalone warmer below. Parallel reconstruction must be done ahead of launch viapython -m nexus.startup.warm_cache. A deployment that previously setNEXUS_WIRE_MAX_WORKERS > 1to parallelize in-launcher wiring must move that to the pre-launch warmer step
Add
- Add
nexus/startup/warm_cache.py(python -m nexus.startup.warm_cache): collects the union of(experiment_dir, permutation_id)tasks across one or more manifests (--manifests-dirmirrors the launcher'sMANIFESTS_DIRenumeration of every*.yaml/*.yml, plus repeatable--manifest), skips already-cached entries, and reconstructs the rest across aspawnProcessPoolExecutor(NEXUS_WIRE_MAX_WORKERS/--max-workers). It pinsOMP_NUM_THREADS/OPENBLAS_NUM_THREADS/MKL_NUM_THREADS/NUMEXPR_NUM_THREADSto1before spawning workers soNworkers useNcores rather thanN × cores(the BLAS oversubscription that made a 32-worker wire thrash all 48 cores at ~38 perms/min). Per-sensorReconstructionError(Limen metric-jitter) failures are logged and skipped - Add
tests/test_warm_cache.py: the warmer dedups tasks within and across manifests, builds the pool with aspawncontext, pins BLAS to one thread, and writes one cache entry per reconstructed sensor
Fix
- Move parallel sensor reconstruction out of the launcher process into a new pre-launch warmer,
nexus/startup/warm_cache.py. The launcher owns Polars' global rayon thread pool (market-data cache); creating a workerProcessPoolExecutorin that process degrades the rayon pool and a later large Polars merge segfaults the process (rayon worker stack overflow → SIGSEGV → restart-loop). Observed on a 5000-permutation deploy:_polars_runtime.abi3.sosegfaults on apolars-Nthread every ~37min, fault address just below the thread stack pointer, regardless of worker count; 0.66.0 (serial, no pool) ran 8h clean. The warmer reconstructs every sensor in a process that never imports Polars and exits before the launcher starts, writes the disk cache, and the launcher then wires inline against the warm cache — keeping the CPU-bound pool and the Polars-using trading runtime in separate processes
v0.53.0 on 28th of May, 2026
Add
- Add
experiment_dir: Pathfield toWiredSensor(and passtask.resolved_dirat construction) so a predict worker can rebuild the (unpicklable) Limen manifest from disk viaTrainer(experiment_dir)._manifestrather than receive it across the pickle boundary. The fittedsensor(small) still rides the submit pickle; the manifest is cached per worker in a module-level_WORKER_MANIFESTSdict so it is built once per worker per experiment dir - Add per-cycle Arrow IPC sharing of the aggregated market-data frame: the parent computes one aggregation per
(kline_size, latest_bar), writes it to a temp Arrow IPC file under a refcounted lifecycle (_ipc_current,_ipc_refs,_maybe_unlink_ipc), and submits each due sensor with(PredictTask, path). Workers read the file (cached per path in_WORKER_MARKET_DATA, bounded to_WORKER_MARKET_DATA_CACHE_MAX=4frames). This means 5000 sensors sharing one kline pay a single parent aggregation per cycle, not one per sensor - Add new module-level worker surface in
predict_loop.py: frozenPredictTaskdataclass,_predict_worker_init,_predict_in_process(task, market_data_path)(rebuild manifest, read IPC, runproduce_signal, return Signal), and_market_data_signaturefor the IPC cache key - Add
NEXUS_PREDICT_MAX_WORKERS(default16) andNEXUS_PREDICT_POLARS_MAX_THREADS(default1); the latter is set viaos.environ.setdefault('POLARS_MAX_THREADS', ...)before pool creation so spawned worker interpreters inherit it. Bounding Polars to one thread per worker stops BLAS-style oversubscription (Nworkers xMrayon threads) without changing parent-side Polars use
Fix
- Replace
PredictLoop's boundedThreadPoolExecutorwith aspawnProcessPoolExecutor, lifting the GIL-boundprepare_datacost out of the predict cycle. On a 5000-permutation 15m deploy, threads do not scale (LimenMLManifest.prepare_datais ~4.4s/predict and ~99.9% Python/Polars — measured 6.37 predicts/sec across 16 spawn workers vs ~0.3 predicts/sec serial; required 5.05/sec to hit the 15-minute cadence SLA). Strategy dispatch, context lookup, and action submission stay in the parent process and are serialized by the pool's result-handling thread, so capital/WAL/risk plumbing is untouched
Update
- Defer
shutdown_sequencer.py'sfrom nexus.strategy.predict_loop import PredictLoopunderTYPE_CHECKING. The import was annotation-only (the file already hasfrom __future__ import annotations), but the existing chainpredict_loop -> nexus.startup -> shutdown_sequencer -> predict_loopblocked a spawn worker from importingpredict_loopas a fresh entry point (the worker must, to unpickle_predict_in_process); the old in-processThreadPoolExecutorpath never re-imported the module from a clean interpreter and so never hit the cycle - Rework
tests/test_predict_loop.pyto drive the parent scheduler via an in-process_SyncExecutortest double plus a stubbed_predict_in_process(autouse fixture scoped toTestPredictLoop). The originalMagicMocksensor/manifest cannot cross a spawn pickle boundary or rebuild a manifest from a non-existent experiment dir, so testing the parent-side behavior (dispatch chain, action_submit forwarding, empty-data skip, predict-error resilience, multi-sensor) requires the executor seam. Adds direct unit coverage of_predict_in_process(the worker assembly path) by patchingTrainerand writing a real IPC frame - Drop the two
_tick_worker/tick_oncedrift-sentinel tests intests/test_predict_loop_tick_once.py(test_chain_markers_present_and_ordered_in_both_paths,test_chain_invoked_in_same_order_as_tick): the invariant they pinned (both paths run an identical step chain) no longer holds — the predict chain is now split between a worker (_predict_in_process->produce_signal) and the parent (_handle_predict_result->_log_signal->dispatch_signal->_action_submit).tick_onceis unchanged (still in-process synchronous), and the runtime parity test fortick_oncealone is retained - Update remaining
WiredSensor(...)construction sites intests/test_predict_loop.py,tests/test_predict_loop_tick_once.py, andtests/test_signal_producer.pyto pass the new requiredexperiment_dirfield
v0.53.1 on 29th of May, 2026
Add
- Add
tests/test_signal_pickle.py: directpickle.dumps/loadsround-trip plus a realmultiprocessing.get_context('spawn')ProcessPoolExecutorround-trip that returns aSignalfrom a worker through the pool's_sendback_resultto the parent'sfuture.result(). This is the exact production failure path; the test fails ifSignal.__reduce__is removed or stops unwrappingvaluesto a plain dict - Add
TestSerializeStateConcurrentMutationtotests/test_wal_codec.py: three threading-barrier tests coveringstate.positions,state.strategy_modes, andstate.risk.per_strategy, plus a round-trip test forstate.capital.per_strategy_deployed. Each barrier test monkey-patches the per-item encoder (_encode_position,_encode_strategy_mode_state,_encode_strategy_risk_state) to block on athreading.Eventduring the first call; a daemon worker thread waits on the inside-barrier, inserts a fresh entry into the live dict, and releases the encoder; the main thread asserts the wait return value and the worker'sis_alive()so a missed synchronisation fails deterministically instead of silently passing. Without the snapshot in the corresponding encoder, the next item-view step raisesRuntimeError: dictionary changed size during iterationand the test fails; with the snapshot, the assertions confirm the injected key is absent from the decoded payload while every pre-insert anchor key is present. The capital path has no per-item helper to patch (the comprehension callsstr(deployed)directly), so it is covered by a round-trip test that exercises the encode + decode with populatedper_strategy_deployed; the snapshot mechanism itself is proven by the analogous barrier tests
Fix
- Add
Signal.__reduce__innexus/strategy/signal.pyso aSignalreturned from a spawnProcessPoolExecutorworker survives the pool's result-pickle path.Signal.__post_init__wrapsvaluesintypes.MappingProxyTypefor immutability, which is not picklable by default. The v0.53.0ThreadPoolExecutor → spawn ProcessPoolExecutorswap inPredictLoopnow pickles every worker return value via the pool's_sendback_result, and the first predict cycle of the v0.53.0 deploy raisedTypeError: cannot pickle 'mappingproxy' objectinside the worker and re-raised atfuture.result()in the parent (the prior in-processThreadPoolExecutornever crossed a process boundary, so the gap was latent).__reduce__re-emits the constructor args withvaluesunwrapped to a plaindict; unpickle re-runs__post_init__and re-wraps it on the receiving side, so consumers still see aMappingProxyTypeand a plainmappingproxynever goes on the wire. Validated as thepraxis:0.68.0-mp1monkeypatch image on prod (run 14:17–15:58 UTC: 16,241signal produced, 4,253command submitted, 0 pickling errors, 0 restarts) - Snapshot every mutable dict iterated inside
serialize_stateviadict()before the per-item encode comprehensions, covering all four sites:state.positionsandstate.strategy_modesat the top level, plusstate.capital.per_strategy_deployedinside_encode_capital_stateandstate.risk.per_strategyinside_encode_risk_state.dict()is a single C-level operation under the GIL and is safe against Python-level mutations from other threads; the comprehensions then iterate the snapshot and cannot observe a mid-serialization insert/pop. The unfixed path raisedRuntimeError: dictionary changed size during iterationwhen anOutcomeProcessor/ dispatch thread mutatedstate.positionswhilestate_store.append_mutation(state)was iterating the live dict; the exception propagated, the outcome ack was withheld by design, and the instance state-machine demoted the operational mode toREDUCE_ONLY— blocking every subsequent ENTER until the next epoch reset.wal_lockis innermost in the lock chain (command_registry_lock -> positions_lock -> CapitalController._lock -> wal_lock), so the per-strategy dicts insidecapitalandriskare equally exposed to concurrent writes from other strategy/risk locks and the snapshot must cover them too
v0.54.0 on 31st of May, 2026
NOTE
- Operational checkpoint + risk-visibility gaps surfaced on the v0.68.x Praxis prod deployment (Praxis #127, Nexus #76).
state_store.checkpoint()ran only at boot-time capital reconciliation (conditional) and graceful shutdown, so the on-disk snapshot drifted indefinitely behind the live state — at one observed point the snapshot was 13.8 h behind the WAL, WAL was 11.5 GB, and read-only recovery to compute current state took 275 s with 12 GB peak RSS. Independently,Position.unrealized_pnlwas set on entry (typically zero) and never re-touched until close, soRiskState.unrealized_pnland every drawdown derivative ran blind to open-book P&L. On the live prod deployment this hid +$3,066 unrealized across 4,161 open positions ($787K cost basis); a 5 % adverse move would have hidden ~$40 K of paper loss from risk gates until each position closed individually
Add
- Add
SnapshotScheduler— wall-clock periodic call intostate_store.checkpoint(state)patterned onHealthLoop(daemonthreading.Timer,start/stop/tick_once, idempotent, lock-safe). Holds thepositions_lock+CapitalController._lockaround the checkpoint call so the snapshot captures a consistent point-in-time view, thenstate_store.checkpoint()acquireswal_lockinternally (same lock pattern asshutdown_sequencer._checkpoint_state). Checkpoint failures are caught and logged at ERROR; the loop continues so a transient I/O error never halts checkpointing. Default interval 300 s — operationally trades disk I/O for shorter WAL replay-on-recovery - Add
MtmLoop— wall-clock periodic mark-to-market ofstate.positions. Three-phase tick to avoid holdingpositions_lock(==state.risk.lock, non-reentrant) across themark_price_providercall: Phase A snapshots the set of held symbols under lock, Phase B fetches marks lock-free (provider can safely re-enter risk APIs without deadlocking), Phase C re-acquires the lock and writes back. For each open position the loop computes(mark - entry) * size * side_signfrom the CURRENTPosition.size/entry_price(so partial-fill mutations between phases are respected), writesPosition.unrealized_pnl, buckets per-strategy intoStrategyRiskState.strategy_unrealized_pnl(creatingStrategyRiskStatelazily for strategies that opened a position but haven't exited yet), and finally writes the instance aggregate viaRiskState.update_unrealized_pnlwhich callsrecompute_drawdown_metricssoequity,equity_hwm,total_drawdown,unrealized_drawdownstay coherent. If the provider returnsNoneor a non-finite mark for any symbol, the tick is aborted without partial writes — stale marks are preferred over inconsistent half-marked snapshots. New symbols opened during Phase B also abort the tick (no mark available); positions closed during Phase B are simply absent from Phase C's iteration. Note: the currentRiskCheckMetricssurface consumed byrisk_stageexposes instance-level fields only, so the per-strategystrategy_unrealized_pnlfield is persisted / visible to telemetry /recover()/ external readers but not yet read by the validator's per-action gates — wiring it through is a follow-up scope. Default interval 30 s - Add
strategy_unrealized_pnl: Decimal = _ZEROfield toStrategyRiskStatewith__post_init__finite-check (signed; can be negative)._encode_strategy_risk_stateemits the new key;_decode_strategy_risk_statedefaults missing values to'0'so snapshots/WAL entries written by older Nexus versions decode without error and the MtmLoop overwrites the zero on the next tick - Add
tests/test_snapshot_scheduler.py(8 cases) pinning the lock-chain contract (checkpoint runs insidepositions_lock+capital_lock_cm), exception swallowing, interval validation, start/stop idempotence, periodic-tick timer-thread firing, and the post-stop in-flight-tick semantics - Add
tests/test_mtm_loop.py(24 cases) pinning long/short sign correctness for marks above and below entry, provider-returns-None abort discipline, provider-returns-non-finite abort, provider-exception abort,update_unrealized_pnltriggeringrecompute_drawdown_metrics, multi-symbol provider-called-once-per-symbol invariant,positions_lockheld during provider calls, per-strategy attribution (eachStrategyRiskState.strategy_unrealized_pnlreflects only its own positions), lazyStrategyRiskStatecreation for strategies that opened a position but never exited, per-strategy zero-reset when a strategy's positions all close, the no-positions empty-state zeroing path, and the lock-cluster invariant (state.risk.lock is positions_lockenforced at construction) - Add
max_total_drawdown: Decimal = _ZEROandmax_total_drawdown_pct: Decimal = _ZEROfields toRiskState;recompute_drawdown_metricsnow ratchetsmax_drawdown/max_drawdown_pctfrom realized-only drawdown and ratchets the newmax_total_drawdown/max_total_drawdown_pctfrom total (realized + unrealized) drawdown. Pre-v0.54.0unrealized_pnlstayed at zero across the runtime (no MTM loop), sototal_drawdown == realized_drawdownalways and the historicalmax_drawdownvalues stored in snapshots are mechanically equivalent to what a realized-only ratchet would have produced; the field's interpretation has been narrowed from "total" to "realized-only" without changing any historical number. With the MtmLoop wired, a transient adverse mark that fully recovers no longer permanently raises the validator's max-drawdown gate (PR #77 review by zero-bang: the validator'sto_risk_check_metricsreadsmax_drawdown_pct, so a calibrated gate threshold stays valid; the newmax_total_drawdown_pctis exposed for telemetry and for any future gate that wants strictly tighter mark-aware discipline)._encode_risk_stateemits both new keys;_decode_risk_statedefaults missing values to'0'so older Nexus snapshots decode without error and the next MtmLoop tick bumps the new field to currenttotal_drawdownif needed
Fix
- Enforce the lock-cluster invariant at
SnapshotSchedulerandMtmLoopconstruction, mirroringShutdownSequencer's pattern atshutdown_sequencer.py:188-216. Wheneverpositions_lockis supplied,state.risk.lockmust be the same object — both loops mutate / readstate.risk.per_strategyand writeRiskStatefields whose mutual exclusion against OutcomeProcessor and the validator depends on lock identity. SnapshotScheduler additionally requirescapital_lock_cmwheneverpositions_lockis supplied; the two form a lock-cluster and partial wiring leaves the capital-sidedictionary changed size during iterationrace against OutcomeProcessor reachable. A mis-wired launcher now fails loudly at construction with the same message shape as ShutdownSequencer rather than producing unguardedper_strategyiteration during a live tick (PR #77 review by zero-bang) - Update
tests/test_risk_state.py:test_recompute_drawdown_metrics_tracks_losses_without_new_peakandtest_recompute_drawdown_metrics_preserves_lifetime_max_drawdownare rewritten to pin the post-v0.54.0 split semantics —max_drawdownno longer ratchets from a transient unrealized loss;max_total_drawdowncarries that lifetime peak instead. The OLD assertions encoded the very behaviour the PR review flagged as questionable; the new assertions verify the validator-stable realized-only ratchet AND the new total-equity ratchet on separate fields - Record TD-091 in
docs/TechnicalDebt.md:SnapshotSchedulerperiodic checkpoint inherits the TD-073 latency-spike class, now recurring every 5 min during live trading rather than only at shutdown.state_store.checkpoint()holdspositions_lock(==state.risk.lock, the validator's lock) through the full serialize + snapshot write + fsync + WAL truncate; the validator's per-action path stalls for the full duration on each tick. Migration path: splitsave_snapshot(state, path, wal)intoserialize(state) -> bytes(under lock) +persist(payload, path, wal)(lock-free, fsync-bound). Restructuringstate_storeinternals is scope creep for this PR; recording the cost via TD entry per the reviewer's minimum-acceptable path (PR #77 review by zero-bang)
v0.55.0 on 4th of June, 2026
NOTE
- Refs Vaquum/Nexus#78 — this PR ships Change 1 only (terminal-aware
order_fillfor the entry-fill notional residual). Change 2 (the 4–5_compute_exit_cost_basisreturn Noneexit-side leak paths inoutcome_processor.py:avg_cost_basis == 0,fill_size > position.size,position is None, cross-strategystrategy_idmismatch, andtrade_id is None) stays open against #78 as a separate follow-up PR; it needs force-release semantics for the recoverable cases andLifecycleResultfailure propagation for the invariant breaches, each of which is a runtime-shape change that needs its own monkeypatch cycle (PR #79 review by zero-bang). Empirically observed on Praxis prod (epoch 10, binsim): 876 strategies carried non-zerostate.capital.per_strategy_deployed[strategy_id]while having ZERO open positions instate.positions. Total ghost-deployed sum ≈ $2,058 across the fleet, averaging $2-7 per closed strategy. The aggregate invariantsum(per_strategy_deployed) == position_notional + working_order_notionalcontinued to hold, so the residuals were real capital "parked" against flat strategies, not a bookkeeping divergence. Pre-fix,CapitalController.order_fillonly removed aTrackedOrderand released its residual whennew_remaining == _ZERO; when execution VWAP was below the reservation reference price (or quantity got snapped down by Binance's LOT_SIZE filter), even a Praxis-side terminally-FILLED outcome left positiveremaining_notionalparked inworking_order_notionalandper_strategy_deployedforever.OutcomeProcessor._handle_fillnever told the capital layer that a fill was terminal, so there was no path to release the residual. Companion Praxis-side qty-snap fix tracked at Vaquum/Praxis#130
Add
- Add
terminal: boolkeyword-only required parameter toCapitalController.order_fill(no default — every caller must make an explicit choice; the Greybeard rationale + caller-migration is in the### Updateblock below). Whenterminal=TrueANDnew_remaining > _ZERO, the controller releases the residualTrackedOrder.remaining_total(remaining_notional + prorated estimated fees) fromworking_order_notionalandper_strategy_deployedafter the existing fee-delta reconciliation, then pops the order from_orders. The two pop branches (new_remaining == _ZEROandterminal) are combined into a single condition since both transition the order to its terminal state. The production caller inOutcomeProcessor._handle_fillpassesterminal=outcome.outcome_type == TradeOutcomeType.FILLEDexplicitly; non-terminal partial-fill behavior (order stays in_orders, residual stays tracked) is preserved when callers passterminal=False - Add 4 new tests under
TestOrderFill(129 cases total, +4 net):test_order_fill_terminal_with_residual_releases_to_zero(terminal + new_remaining > 0 → working drops to 0, deployed drops to actual cost basis, order popped),test_order_fill_non_terminal_keeps_residual(terminal=Falsecall preserves partial-fill semantics — order stays in_orders, residual stays tracked),test_order_fill_terminal_exact_match_matches_non_terminal_exact(terminal + new_remaining == 0 is byte-identical to the pre-existing exact-match branch — proves no regression on the common full-fill path),test_order_fill_terminal_residual_includes_proportional_fees(pin on the proportional-fee accounting — the released residual covers the unfilled fee component, not just the unfilled notional, so per_strategy_deployed lands exactly atfill_notional + actual_feeswith no fee-ghost)
Update
- Thread the new
terminalflag throughOutcomeProcessor._handle_fillat the entry-fillorder_fillcall site. The flag is derived asoutcome.outcome_type == TradeOutcomeType.FILLED— Praxis-sideFILLEDis the terminal status (no more fills coming for this command_id) whilePARTIALis non-terminal (more fills expected, residual must stay tracked). Other outcome types (REJECTED, CANCELED, ACK) reach different_handle_*paths and never callorder_fill, so the change is localized to the entry-fill branch. The 56 existingoutcome_processortests pass unchanged - Pre-PR Greybeard review: make
terminalkeyword required (no default). The original draft hadterminal: bool = Falsefor backward compat, but defaulting it would let any future caller silently recreate the v0.55.0 residual-leak bug by omission. Every existing test caller (25 sites intests/test_capital_controller.py) is updated to passterminal=Falseexplicitly. The production caller inOutcomeProcessor._handle_fillalways passes the derived value - Pre-PR Greybeard review: defensive invariant guard inside the terminal-release branch —
residual = updated.remaining_totalis checked>= _ZERObefore being subtracted fromworking_order_notionalandper_strategy_deployed. A futureTrackedOrderrefactor that letsremaining_totaldrift negative would have silently inflated aggregates; the guard returnsINVARIANT_BREACHinstead - Pre-PR Greybeard review: add
TestEntryFillTerminalThreading(2 cases) totests/test_outcome_processor.pypinning the OutcomeProcessor → CapitalController contract end-to-end.test_fill_outcome_terminal_releases_residualprovesoutcome_type=FILLEDzeros the residual on under-fill;test_partial_outcome_non_terminal_keeps_residualprovesoutcome_type=PARTIALkeeps the order in_ordersfor the next fill. A future refactor that drops theterminal=kwarg at the call site, or remapsoutcome_typeto terminal incorrectly, fails these tests - Pre-PR Greybeard review (deferred to TD): record TD-092, TD-093, TD-094 in
docs/TechnicalDebt.md. TD-092:order_fillhonors caller-suppliedterminalflag without verifyingfill_notionalreachedorder.notional— defensive guard against future translator/adapter misclassification. TD-093: combinedif new_remaining == _ZERO or terminal:pop branch obscures the two distinct pop reasons. TD-094: two_adjust_strategy_deployedcalls back-to-back in the terminal-release branch could be combined into one delta. All three are readability / defensive-coding improvements with no current behavioural impact - Post-PR-review fix (PR #79 review by zero-bang): hoist the
residual >= _ZEROinvariant guard inCapitalController.order_fillbefore any state mutation. The original Greybeard guard ran after the order was popped,working_order_notional/position_notional/fee_reservehad been mutated, and_adjust_strategy_deployedhad been called forfee_delta— if the guard ever fired, callers seeingINVARIANT_BREACHcould retry and double-apply the already-committed mutations. The fix computesterminal_residual = updated.remaining_totalupfront in thenew_remaining > _ZERObranch (alongsidefill_with_estimatedandproportional_estimated) and checks it before any mutation; on negative residual the function returns failure without touching state. Behavioural impact is zero on every currently reachable path (the structural invariantfill_notional <= order.remaining_notionalplusestimated_fees >= 0keepsupdated.remaining_total >= 0), but a futureTrackedOrderrefactor can now fail safely
v0.56.0 on 6th of June, 2026
NOTE
- Quote-native MARKET BUY plumbing on the Nexus side ships alongside Praxis's matching adapter work on
feat/quote-qty-market-buy(Vaquum/Praxis companion branch). The two PRs are paired: Nexus alone is a no-op (the newAction.quote_qtyfield threads throughtranslate_to_trade_commandandPraxisOutbound.send_command, but Praxis must acceptquote_qty=onsubmit_commandfor any quote-native ENTER to actually leave Nexus). Background: the v0.55.0 Praxis 200-bps reservation buffer (order_notional = order_size * reference_price * Decimal('1.02')) compensated for kline-staleness slippage on MARKET BUY ENTERs where the venue's fill VWAP exceeded Nexus's reservation-time reference price (fill_notional > reserved →order_filloverfill rejection). Option C ([this PR + companion]) replaces the buffer with Binance's nativequoteOrderQtyparameter: strategy emits a quote-asset spend cap, venue computes the executed base qty from live liquidity, reservation matches spend exactly. Eliminates the staleness gap at the source instead of papering over it
Add
- Add
quote_qty: Decimal | None = Nonefield toActionwith__post_init__validation: finite positive Decimal orNone; mutually exclusive withsizeon ENTER (exactly one required); must be unset on EXIT; ENTER withquote_qtyis restricted todirection == OrderSide.BUYandorder_type == OrderType.MARKETso a malformed action is rejected at strategy boundary before any reservation is taken (Binance'squoteOrderQtyREST parameter only accepts MARKET BUY) - Add
quote_qty: Decimal | None = Nonefield toTradeCommandwith__post_init__validation: finite positive Decimal orNone; onNEW_ORDERrequires exactly one ofsizeorquote_qty; must be unset onAMEND_ORDERandCANCEL_ORDER.translate_to_trade_commandthreadsaction.quote_qtyinto the command; when set,TradeCommand.sizeisNoneand the venue determines the executed base from live liquidity.PraxisOutbound.send_commandsendsquote_qty=command.quote_qtyto Praxis'ssubmit_command; the Praxis side decides whether to map it to Binance'squoteOrderQtyparameter or reject
Update
- Switch
logreg_binary_evsfdENTER fromsize = notional / reference_pricetoquote_qty = capital_available * _ENTER_CAPITAL_FRACTION— the strategy ships a quote-asset spend cap directly. No reference-price guard is required for sizing (capital is in quote units), so the early-return-on-no-price path is removed from_enter;reference_priceis still forwarded for slippage observation by Praxis but is no longer load-bearing for the order shape - Relax ENTER intake at
make_reference_integrity_hookto acceptorder_size is None(quote-native ENTER carries no base size at submission time, only a notional spend cap). Enforcement is two-layer and already covered before the hook runs: the built-inINTAKE_ORDER_NOTIONAL_ZEROcheck atvalidate_intake_stageline 404 rejects ENTER withorder_notional <= 0; the ref-hook then rejects explicit non-positiveorder_size(size set but<= 0) withINTAKE_ENTER_SIZE_INVALID. Quote-native ENTER (order_size is None,order_notional > 0) falls through to allowed - Make
OrderContext.order_sizeDecimal | None; required for EXIT (the controller's_clear_pending_exitpath reads it for cancellation/reject release), optional for ENTER (the entry path usesoutcome.fill_sizefrom the venue rather than the pre-submit reservation).__post_init__checksis_entrytype first so a non-bool slipping through cannot bypass the size-required-for-EXIT branch
Fix
- Tests added for the new validation surfaces:
Action(quote_qty=...)BUY+MARKET enforcement,TradeCommandNEW_ORDER XOR (size/quote_qty),intake_stagerelaxation (quote-native happy path passes,order_size=Decimal('0')still fails)
v0.57.0 on 9th of June, 2026
NOTE
- Vaquum/Nexus#82: in Praxis prod (epoch=16, v0.75.0, ~3h post-deploy) 1,325 trades were stuck in an infinite EXIT-retry loop, each emitting an
INTAKE_BELOW_MIN_QTYrejection at the Praxis launcher every 15–30 min. Root cause: full-position EXIT actions emitAction.size = position.size - position.pending_exitin full Decimal precision (e.g.0.01000842BTC); the Praxis launcher'squantize_for_commandsnaps toLOT_SIZE.stepSize(e.g.0.01000000) before submitting; the post-fill_reduce_positionin this codebase decrementedposition.sizeby the snapped qty, leaving0.00000842BTC residue;Position.is_closedis exact-zero so the residue kept the trade alive instate.positions; the next tick's full-position EXIT computed the residue as its size; the launcher'squantize_for_commandrejected the sub-lot qty as belowlot_min;_build_exit_contextreturnedNoneand the cycle repeated forever. Two blocker paths flow through the same launcher function — post-fill residue (B1) and pre-submit sub-lot rejection (B2). This release adds the Nexus-side schema and behavior so both paths can close the dust cleanly; the matching Praxis-side changes ship as Vaquum/Praxis#142. The design routes the intent flag through the launcher boundary and closes residue at the terminal fill; the field had to live on bothValidationRequestContextandOrderContextbecausepraxis/launcher.py:_build_order_contextre-runsbuild_contextrather than passing the original through, so a field only onOrderContextwould be lost across the rebuild.
Add
- Add
intended_full_close: bool = FalsetoValidationRequestContext.__post_init__validates it's abool. Set by the Praxis launcher's_build_exit_contextwhenAction.size == position.size - position.pending_exit(exact Decimal equality) — the strategy intended to close the trade completely, so any sub-lot residue from a snapped fill is dust by definition. DefaultFalsepreserves all existing callers. - Add
intended_full_close: bool = FalsetoOrderContext. Carried across the_build_order_contextrebuild on the Praxis launcher (praxis/launcher.py:913) by explicit field-copy.__post_init__validates it's aboolAND rejectsintended_full_close=Truetogether withis_entry=True— the flag only makes sense on EXIT orders. DefaultFalsepreserves all existing callers. - Add
account_dust: dict[str, Decimal] = field(default_factory=dict)toInstanceState. Symbol-keyed (BTCUSDT → BTC residue). Populated when sub-lot residue from a snapped EXIT fill needs to be accounted for.__post_init__validates every key is a non-empty string and every value is a finite non-negativeDecimal. - Add
OutcomeProcessor.close_as_dust(trade_id, reason, dust_close_id)(outcome_processor.py). Called by the Praxis launcher when intake-time venue quantization rejects a full-close EXIT as sub-lot — closes the position without any venue interaction, movesposition.sizeintostate.account_dust[symbol], removes the position fromstate.positions. Idempotent ondust_close_idvia a new_processed_dust_close_ids: set[str](separate from_processed_outcome_idsso the dust-close dedup is independent). ReturnsFalseon dedup hit or missing position;Trueon successful close. Does NOT emitTradeClosed/TradeOutcomeProduced— no venue order ever existed and those events are owned by Praxis'sExecutionManagerafter a real fill. - Add 14 new tests across
tests/test_outcome_processor.py(7 cases underTestDustClosecovering B1 residue → dust, B2 close_as_dust happy path + idempotency + missing-position + per-symbol accumulation),tests/test_order_context.py(4 cases covering the new field default, EXIT validity, non-bool rejection, is_entry+intended_full_close rejection), andtests/test_wal_codec.py(3 cases covering empty and populated roundtrips + legacy-snapshot-without-account_dust defaults to{}).
Update
- Update
OutcomeProcessor._reduce_position: after the existingposition.size = position.size - fill_sizedecrement, ifoutcome.outcome_type == TradeOutcomeType.FILLEDANDcontext.intended_full_closeANDposition.size > _ZERO, move the residue intostate.account_dust[position.symbol], zeroposition.size, then fall through to the existingif position.is_closed: del state.positions[trade_id]branch. Partial-exit and non-terminal-fill paths are unchanged. - Update
wal_codec.serialize_stateto encodeaccount_dustas{symbol: str(Decimal)}alongside the existing fields._decode_state_v1readsaccount_dustviad.get('account_dust', {})so snapshots written before this release (noaccount_dustkey) load cleanly with the field defaulted to{}.
Fix
- Closes Vaquum/Nexus#82. Companion Praxis-side fix at Vaquum/Praxis#142 — the launcher changes that compute
intended_full_close, carry it through_build_order_context, and callOutcomeProcessor.close_as_dustin the rejection branch ship there. Nexus alone is dormant until that companion lands (the new field defaults toFalseso behavior is unchanged on every existing caller).
v0.58.0 on 10th of June, 2026
NOTE
- During the Praxis v0.76.0 paper-trade validation (epoch 22, 2026-06-10), once outcome processing kept pace with strategy ticks, every EXIT ACK surfaced as
order_ack failed: order '<command_id>' not found— 232+ failures in under an hour. Root cause:CapitalController.order_acktransitions aTrackedOrderfrom IN_FLIGHT to WORKING, butTrackedOrders are only created bysend_orderfrom a capital reservation, and EXIT commands never reserve capital. The failure is structural — an EXIT ACK can never find an order record. It predates this release; the historicalOutcomeLoopqueue lag simply meant EXIT ACKs were rarely processed promptly enough for the failure to surface in volume.
Update
- Update
OutcomeProcessor._handle_ackto accept theOrderContextand return a no-op success foris_entry=Falseoutcomes — the venue acknowledged the sell and there is no capital lifecycle to transition. ENTER ACKs are unchanged: they still callCapitalController.order_ackand transition IN_FLIGHT to WORKING. The no-op success also restores the normalOutcomeAckedspine append on the Praxis side, so EXIT ACK outcomes no longer accumulate un-acked in the event spine and replay cleanly at boot
Add
- Add 3 tests to
tests/test_outcome_processor.py::TestOutcomeProcessorAck: EXIT ACK returns success withcapital_updated=False; EXIT ACK leavesin_flight_order_notionalandworking_order_notionaluntouched while an unrelated ENTER order is in flight; ENTER ACK still transitions the full reserved total from in-flight to working
v0.59.0 on 11th of June, 2026
NOTE
- During the Praxis v0.77.0 paper-trade validation (epoch 24, 2026-06-11), two commands lost their fill accounting entirely: binsim fills in ~50ms, and the launcher's submitter registers
command_strategy_ids/command_contextsonly aftersend_commandreturns for the whole batch — so the translated ACK and FILLED outcomes reached theOutcomeLoop~1ms before registration became visible. The synchronous accounting path skips on missingOrderContext(by design, deferring to the async path), and theOutcomeLoopdropped the outcomes terminally on theresolve_strategy_idmiss. Net effect: a venue-filled EXIT whose position reduction never ran, leaving the position stuck until boot replay (the outcomes were never acked, so replay heals it by accident). The drop is the defect: an unresolved strategy id at outcome time is almost always this transient registration race, not an unknown command
Update
- Update
OutcomeLoop.tick_onceand the new_try_dispatch/_park/_service_unresolved_retriesinternals so an unresolvedstrategy_idis retried instead of dropped: the outcome opens a per-command FIFO retry queue scheduled on the new module constantUNRESOLVED_RETRY_DELAYS(50ms, 100ms, 250ms, 500ms, then 1s steps — ~5.9s total window; the ramp catches the ~1ms registration race on the first retry, and the 1s cap bounds heal latency since the retry is an in-process dict lookup with no resource pressure to back off from). A fresh outcome whose command already has a parked queue is funnelled behind its siblings instead of dispatched inline — only the head attempts resolution and consumes attempts, a resolved head drains its whole queue in order, so a command's outcomes can never reorder across the retry detour (FILLED before its raced ACK would failCapitalController.order_fill's WORKING requirement and lose the fill via a failure result nothing retries). A successful retry runs the full dispatch chain (process_outcome, strategy callback,action_submit), so the raced fill is accounted, persisted, and acked normally. Exhaustion drops the whole command queue, logging each outcome at ERROR withcommand_id,outcome_id,outcome_type, attempts, the retry window, the outcome age, and the dropped queue size, replacing the previous silent warning-and-skip
Add
- Add 5 tests to
tests/test_outcome_loop.py(TestUnresolvedRetry): a raced outcome dispatches exactly once after registration lands; retry exhaustion drops with an empty retry map and no dispatch; sibling ACK/FILLED order is preserved when both raced; a fresh resolvable FILLED funnels behind its parked raced ACK instead of dispatching inline, and the pair drains in original order; a sibling whose resolution vanishes mid-drain is re-parked as the new queue head and drains in order once it resolves again
v0.60.0 on 13th of June, 2026
Add
-
Add deterministic-command-id passthrough to
PraxisOutbound:send_commandtransmits the Nexuscommand.command_idto the injected submit function when that function accepts it (detected once at construction viainspect.signature, exposed as the publicsupports_command_idproperty), so Praxis adopts the Nexus identity verbatim instead of minting its own. A new Nexus stays safe against an old Praxis that lacks the parameter (no kwarg passed). Detection distinguishes an explicitcommand_idparameter (authoritative — a divergent returned id raisesCommandIdMismatchErrorso the caller rolls back rather than holding a registration keyed on an id the venue command does not carry) from a**kwargscatch-all (best-effort — the kwarg is passed but a divergent return is tolerated, since such a receiver may be a legacy submit wrapped in**kwargs). Closes the registration race at its root: identity exists before the command can execute (#86) -
Add
SubmissionStatus.SUBMISSION_UNKNOWN, theSubmissionRegistrationprotocol (mark_submitted/mark_unknown/rollback), and an optionalpre_registercallback tosubmit_actions. When the launcher supplies apre_register(only whensupports_command_idis true), the command's lifecycle is bridged before thesend_commandhandoff, and a handoff timeout becomesSUBMISSION_UNKNOWN— reservation and registration retained for reconciliation by the deterministic id — instead ofSUBMIT_FAILEDreleasing capital for a command that may still execute. A non-timeout failure callshandle.rollback; apre_registerfailure is pre-handoff (reservation released,SUBMIT_FAILED); each handle callback is exception-contained so a buggy handle cannot abort the tick. With no handle (legacy / old Praxis) the prior submit-then-register behavior is exactly preserved (#87) -
Add
StateSnapshotLocksand an optionalsnapshot_locksparameter toStateStore: when supplied,append_mutationandcheckpointacquirepositions_lockthencapital_lock(the documented chain order) around theserialize_statecall, so a snapshot can no longer interleavestate.positions/state.account_dust/ capital reads with a concurrent mutation on another thread (the OutcomeLoop worker, the Praxis synchronous-accounting path, or the submitter'spending_exitwrites) — closing the torn-snapshot / dict-changed-during-iteration window at the codec boundary rather than relying on every call site to wrap the call.append_eventdoes not take the locks (it serializes aStrategyEvent, notInstanceState); construction without the bundle preserves the prior unguarded contract (#88) -
Add 4 tests to
tests/test_state_store.py:append_mutationandcheckpointacquire the locks in chain order;append_eventtakes neither; legacy construction without locks is unchanged
Fix
- Fix the timing-flaky
test_broken_pool_submit_does_not_kill_schedulerintests/test_predict_loop.py: poll for the IPC refcount drain with a deadline instead of a fixed sleep (#89)
v0.61.0 on 13th of June, 2026
NOTE
- Completes the snapshot-lock ownership move begun in v0.60.0. v0.60.0 added the opt-in
StateSnapshotLocksbundle but left it unwired, because enabling it conflicts with the two sites that already wrapStateStore.checkpoint()in the same locks: once the store acquirespositions_lock+capital_lockinternally, an external wrap re-acquires non-reentrant locks and self-deadlocks. This release moves snapshot-serialization locking fully intoStateStoreand deletes both external checkpoint wraps._final_checkpointandSnapshotScheduler._checkpointnow callcheckpoint()bare; the store owns the locking when the launcher builds it with the bundle. Thestate.risk.lock is positions_lockidentity that the wraps used to enforce (sopositions_lockalso coveredstate.risk.per_strategyserialization) now belongs at the launcher composition point where the bundle is built — not in these loops, which no longer serialize state.ShutdownSequencerkeepspositions_lockonly for its directstate.positionsaccess (_dispatch_shutdown,_submit_exit), which the bundle does not cover (#92)
Update
- Update
ShutdownSequencer._final_checkpointto callstate_store.checkpoint()directly with nopositions_lock/capital_lockwrap —StateStoreowns the snapshot locks via itsStateSnapshotLocksbundle and acquires them in the same chain order insidecheckpoint(), so an external wrap would re-acquire the same non-reentrant locks and self-deadlock. FINAL-MAJOR-05 coverage (state.positions/risk.per_strategy/capital.per_strategy_deployedserialization cannot race a live OutcomeLoop worker) is preserved by the bundle plus the launcher'sstate.risk.lock is positions_lockwiring - Remove the
capital_controllerparameter fromShutdownSequencer: it was used only by the deleted_final_checkpointwrap. Thestate.risk.lock is positions_lockandcapital_controller-required construction guards are removed with it — the identity is now enforced at the launcher where the bundle is built.positions_lockstays for the directstate.positionsiteration sites - Remove the
positions_lockandcapital_lock_cmparameters fromSnapshotSchedulerand its construction guards:_checkpointnow callsstate_store.checkpoint()bare (the store owns the locks), so the scheduler no longer needs them
Add
- Add tests to
tests/test_shutdown_sequencer.py: a realStateStorebuilt with theStateSnapshotLocksbundle completes_final_checkpointwithout deadlocking (the store acquires the locks the method no longer wraps);_final_checkpointholds no externalpositions_lockduring the store call; and the sequencer acceptspositions_lockwithout enforcing thestate.risk.lockidentity
v0.62.0 on 13th of June, 2026
NOTE
- Enables the v0.61.0 snapshot-lock ownership move to be wired from the Praxis launcher, which could not pass the
StateSnapshotLocksbundle atStateStoreconstruction: the store must exist first soStartupSequencercan recoverInstanceState, and only after recovery do thepositions_lock/capital_lockand the recoveredstateexist. The recovery-then-runtime split is a legitimateStateStorelifecycle, so the store now exposes a post-construction attach point rather than forcing the launcher to reach into a private attribute
Add
- Add
StateStore.attach_snapshot_locks: a one-shot setter that attaches theStateSnapshotLocksbundle after construction, soappend_mutation/checkpointacquire it aroundserialize_stateexactly as if it had been passed to__init__. Behaviorally identical to construction-time injection because_state_read_guardreads the bundle per call; the caller attaches after recovery and before any concurrent mutator starts. RaisesRuntimeErroron a second attach (a re-attach would silently swap the locks live mutators rely on) andTypeErroron a non-StateSnapshotLocksargument (aNonewould leave serialization silently unguarded) - Add 4 tests to
tests/test_state_store.py::TestStateSnapshotLocks: a lateattach_snapshot_locksengages the lock guard on the nextappend_mutation/checkpoint(and not before); a second attach raisesRuntimeError; a non-bundle argument raisesTypeError; a second attach with a non-bundle argument still raisesRuntimeError(the already-attached guard is checked before the type check)
v0.63.0 on 15th of June, 2026
BREAKING
- Replace the in-process Limen sensor path with Furnace Conduit prediction consumption. The per-strategy manifest block
sensors: [{experiment, permutation_ids, interval_seconds}]becomes a singlesignal: {series, interval_seconds, stale_policy, name?}binding to a Conduit prediction series;SensorSpecis replaced bySignalSpecandStrategySpec.sensorsbyStrategySpec.signal.WiredSensoris replaced bySignalBindingandStartupSequencer.wired_sensorsbyStartupSequencer.signal_bindings.PredictLoopdrops themarket_data_provider/wired_sensorsconstructor parameters in favour ofsignal_bindingsplusconduit_dir/arrow_dir. Downstream launchers must update the manifest schema and thePredictLoopwiring and mount thefurnace_conduit(/opt/conduit) and control-plane Arrow (/opt/arrow) volumes read-only
NOTE
- Removes boot-time sensor reconstruction entirely (no
Trainer.train()at startup), eliminating the long blind-boot window and the cross-version metric-driftReconstructionErrorthat inline reconstruction produced. Predictions are now read from Furnace's serving manifest and per-series prediction Arrow frames — the producer applies the model; consumers need onlypolars
Add
- Add
SignalSpec(series,interval_seconds,stale_policy='skip',name) andSignalBinding(strategy_id,series,interval_seconds,name);StartupSequencerbuilds oneSignalBindingper strategy directly from the manifest with no filesystem,Trainer, or sensor cache - Rewrite
PredictLoopas a single-process Conduit poller: one daemon thread polls each binding oninterval_seconds, re-readsserving_manifest.json(skips the tick whengenerated_atis older than 120s or the series is absent), takes the greatest-tsreason_code == 0row from/opt/conduit/<series>/latest.arrow, dedupes by(strategy_id, series, ts), logs the active cohort and emits a distinct change event whencohort_idchanges (never gating), joins the matchingclosefrom/opt/arrow/<series>/latest.arrow(skips when absent), and dispatchesSignal{_preds, _probs, close}; a failed tick is logged and the thread continues
Remove
- Remove the
vaquum_limendependency and the runtime Limen path:WiredSensor/SensorSpec,nexus.strategy.signal_producer,nexus.startup.sensor_cache,nexus.startup.warm_cache, thePredictLoopProcessPoolExecutor+ market-data IPC, and the sensor disk cache. Addpolarsandnumpyas direct dependencies (previously transitive throughvaquum_limen)
v0.63.1 on 16th of June, 2026
Update
- Prune the technical-debt register in
docs/TechnicalDebt.md: collapse code-verified-resolved (TD-004, TD-005, TD-006, TD-010, TD-011, TD-013, TD-015, TD-016, TD-017, TD-018, TD-023) and Conduit-obsoleted (TD-019, TD-020, TD-021, TD-022, TD-087, TD-088, TD-089) entries to heading-only status markers, and mark TD-051 RESOLVED (_reduce_positionalready nets exit fees atoutcome_processor.pyviarealized_pnl = gross_pnl - actual_fees)
v0.64.0 on 16th of June, 2026
Fix
- Stop boot reconciliation from silently deleting a Nexus position absent from the Praxis snapshot.
_reconcile_capitalpreviously evicted such positions ("Praxis truth wins") and checkpointed the deletion, so a restart could discard a live position and orphan the venue holding. It now preserves the position and fails closed (raisesStartupError) so the divergence is investigated rather than resolved by data loss. Pairs with the Praxis fix that stops entry fills from emittingTradeClosed(which made Praxis under-report open positions on replay) - Match Praxis positions on
pos.trade_idrather than unpacking the snapshot tuple key in_reconcile_capital. Praxis keys positions(trade_id, account_id)but reconcile read element[1](the account_id) as the trade_id, so every Praxis position mis-bucketed and never matched the Nexus side
v0.65.0 on 16th of June, 2026
Add
- Add
test_decode_capital_state_snaps_subulp_negative_residueandtest_decode_capital_state_rejects_meaningful_negativetotests/test_wal_codec.py - Add TD-096 recording the structural follow-up (collapse the two-step terminal residual release in
order_fillinto one exact decrement)
Fix
- Snap sub-ULP Decimal residues in
CapitalControllercapital aggregates to zero so a restart cannot brick on recovery. After a fee-bearing terminal fill, the reserve/release arithmetic (proportional-fee division inTrackedOrder.remaining_total) could leaveworking_order_notionalat a sub-ULP negative (e.g.-1E-27);CapitalState.__post_init__rejects any negative, sodeserialize_statefailed and the instance crash-looped on boot.order_fillnow snapsworking_order_notional,fee_reserve, andper_strategy_deployedresidues within_SUB_ULP_TOLERANCEto zero (thefee_reservesnap previously handled only tiny negatives;_adjust_strategy_deployednow treats sub-tolerance magnitudes as zero rather than logging a false underflow). Latent until the Praxis fee fix madeactual_feesnon-zero - Add a narrow recovery shim in
wal_codec._decode_capital_state: snap sub-tolerance negative persisted aggregates to zero before constructingCapitalState, so snapshots already carrying a residue boot. TheCapitalStatenon-negative invariant stays strict — only sub-_SUB_ULP_TOLERANCEnegatives are snapped; meaningful negatives still raise
v0.66.0 on 19th of June, 2026
Add
- Add
TestProcessedDedupIdstotests/test_wal_codec.py: the durableprocessed_outcome_ids/processed_dust_close_idssets survive a serialize → deserialize round-trip, default to empty, and a pre-Nexus#86 payload missing the keys decodes to empty sets - Add
TestOutcomeProcessorDurableDeduptotests/test_outcome_processor.py: an applied outcome replayed against a recovered (serialize → deserialize) state returns a no-op success with no second capital or position mutation, and a dust-close id survives recovery
Fix
- Make the outcome-dedup durable so a boot replay cannot double-apply an already-applied outcome (Nexus#86 / TD-086).
OutcomeProcessorpreviously held the processedoutcome_ids in a process-local set, lost on restart; combined with the mutation being persisted by the launcher'sappend_mutation, a replay of an un-acked-but-already-applied outcome (process killed betweenappend_mutationand the PraxisOutcomeAcked) re-entered_handle_filland mutated capital and position a second time. The dedup sets now live onInstanceState(processed_outcome_ids,processed_dust_close_ids), so the successful id is persisted atomically with the mutation it guards and restored byStateStore.recover; the replay is recognised and returns a no-op success. The same durability now also coversclose_as_dust. Serialized via the existingwal_codecv1 payload with.getback-compat, so pre-upgrade snapshots load unchanged - Perform the durable dedup-set writes under
positions_lock(the lock domainserialize_statereads under, matching theaccount_dustprecedent) instead of only_dedup_lock, so a concurrentSnapshotScheduler.checkpoint()cannot serialize the set mid-write; the check+add stays atomic under the nested_dedup_lock(preserving the PR #83 concurrent-same-id guarantee). A narrow checkpoint-interleave window between the capital mutation and the dedup add remains, tracked in TD-086 (record-before-mutate)
v0.67.0 on 22nd of June, 2026
Add
- Add an injectable
clocktoCapitalController: reservation creation, the reservation-expiry check, and the expiry purge now read the current UTC time from a supplied source rather than the wall clock. It defaults to wall time so the live path is unchanged; a deterministic replay injects a cursor advanced per bar so reservations expire on simulated time - Add
TestInjectedClocktotests/test_capital_controller.py: a reservation'sexpires_atis computed from the injected clock, and both_purge_expiredandsend_order's expiry check honour it
v0.68.0 on 9th of July, 2026
Add
- Add
ModeControllerarbitrating operational mode against sticky manual and risk halt holds; it writesstate.modeon the health-and-hold-arbitrated path. It is not yet the process-wide sole writer —StartupSequencerandShutdownSequencerstill setstate.modedirectly, and wiring the controller into the launcher (construction,reconcilebefore startup drain,on_halt, routing shutdown/manual through holds) is tracked as follow-on live-safety work; this release is the library only - Add
HaltHold/OperationalHoldsonInstanceState.mode_holds, persisted through the WAL codec with backward-compatible decode - Add
RiskBreakerThresholdsandModeController.evaluate_riskfor daily-loss and drawdown circuit-breakers evaluated on the health tick. Breakers trip on a strict breach (observed > limit, matchingrisk_stage), readRiskStateunderstate.risk.lock_cm()so the per-strategy sum and drawdown reads are consistent against concurrentOutcomeProcessor/MtmLoopwriters, and reject non-positive thresholds (Nonedisables a breaker) - Add
ModeController.reconcileto re-derive the mode on restart before startup actions drain - Add an optional
on_haltcallback fired outside the lock when the mode transitions to HALTED - Route
HealthLoopmode writes through an optionalModeController - Parse per-account
risk_controlsfrom the manifest intoRiskBreakerThresholds
v0.69.0 on 10th of July, 2026
Fix
- Guard the
ModeControllerrisk-breaker read against a self-deadlock when the RiskState lock is the controller's own lock. The launcher wiresModeController,positions_lock, andstate.risk.lockto one sharedthreading.Lock, soreconcile/evaluate_risk/apply_health_and_risk— which since v0.68.0 acquiredstate.risk.lock_cm()inside the already-held mode lock — re-entered the same non-reentrant lock and hung the boot thread inreconcilebefore it reached the run loop, so shutdown never completed._risk_reads_cmnow returns a no-op context manager whenstate.risk.lockis the mode lock (the held mode lock already serialises the reads) and acquires the RiskState lock only when it is a distinct object. The v0.68.0 unit tests missed this because they leavestate.risk.lockunset (None→nullcontext); only the shared-lock launcher wiring triggers it. Newtest_shared_lock_wiring_does_not_deadlockdrivesreconcile/evaluate_risk/apply_health_and_riskunder the shared-lock wiring and asserts they complete.
v0.70.0 on 12th of July, 2026
Add
- Persist the last health-derived mode as
InstanceState.health_modeso it survives a restart.ModeControllernow reads and writesstate.health_mode(previously an in-memory_health_mode), andreconcilerecommits from it directly rather than seeding only when the recoveredstate.mode.triggerwas'health'. Before this, a health-derived REDUCE_ONLY was lost across a restart whenever a hold masked it as HALTED (recoveredtriggerread'manual'/'risk', so the seed never fired and the fresh controller defaulted_health_modeto ACTIVE); clearing the hold then resumed ACTIVE instead of REDUCE_ONLY.wal_codecencodeshealth_modeand decodes it with a backward-compatible ACTIVE default for pre-field snapshots - Add a dedicated
shutdown_holdtoOperationalHoldsandModeController.set_shutdown_halt/clear_shutdown_halt._mode_sourceranks it above manual and risk, so the shutdown HALT reportstrigger='shutdown'and cannot be lifted by a concurrent health tick.wal_codecround-trips it with a backward-compatible inactive default.reconcileclears any recovered shutdown hold at boot — it is transient to the shutdown that placed it, and the final checkpoint persists it, so a restart would otherwise recover it active and boot HALTED with no way for operator-resume (which clears only the manual hold) to lift it
Fix
- Make
ModeControllerthe sole writer ofstate.modeon the live path.StartupSequencer._determine_modenow writes its boot decision intostate.health_mode(the health input) instead of committing aModeStatewith aboot_*trigger; the launcher'sModeController.reconcile, which runs afterstart, commits it. This also fixes a boot clobber: previously_determine_modeset REDUCE_ONLY (no-health-data safety) and thenreconcileoverwrote it with ACTIVE, becausereconcileonly seeded the health mode when the trigger was'health'and the boot trigger was'boot_no_health_data'.ShutdownSequencer._halt_state_modenow places the shutdown hold through an injectedModeController(falling back to a directstate.modewrite only in single-threaded test paths) so an in-flight outcome cannot resume trading mid-shutdown
v0.70.1 on 21st of July, 2026
Update
- Replace the repository-template
README.mdwith the real module README following the shared Vaquum module README structure: header block with tagline, anchor nav, and badges,What Nexus Is Not,Capabilities,First Strategyquickstart,Risk Boundary, and the standard tail. Every claim is backed by code onmain; the quickstart manifest and Python snippets were executed verbatim against a fresh install of this version
v0.71.0 on 5th of August, 2026
Add
- Add a runtime amend path from a strategy
MODIFYaction to Praxis.Actiongains amodify_paramsmapping carrying mode-specific absolute new values (rejected when empty), and a MODIFY action now requirescommand_id,execution_mode(selecting the amend-parameter shape), andmodify_params.PraxisOutbound.send_modifybridges a validated amend to an injectedsubmit_modify_fn(PraxisTrading.submit_modify); the launcher wiringPraxisOutboundmust supplysubmit_modify_fnfor a strategy MODIFY to reach Praxis, and without itsend_modifyraisesRuntimeError - Route a strategy
MODIFYthrough the validator rather than bypassing it:submit_actionsvalidates the amend and only then callssend_modify, so the intake operational-mode gate (HALTEDblocks amends, unlikeABORT/CANCELwhich only wind down) and themodifiable_command_idslifecycle check apply. An amend re-parametrizes an already-sized command and never changes total notional, soMODIFYjoins the exit actions in the capital/risk/health/price/platform bypass set — no new capital is reserved. A validated MODIFY carries noTradeCommand, sotranslate_to_trade_commandnow rejectsMODIFYfail-fast instead of mapping it to a payload-lessAMEND_ORDER - Add a
modifiable_command_ids_providerform tomake_reference_integrity_hook/build_default_intake_hooks, re-invoked per validation so the live (tick-to-tick) amendable-command set reaches the MODIFY check; the provider takes precedence over a statically captured set, and MODIFY stays denied when neither is supplied
v0.72.0 on 11th of August, 2026
Add
- Add the Praxis-side reconciliation inbound.
FundTransactionandReconciliationMismatchmirror the Praxis reconciliation events.OutcomeProcessor.process_fund_transactionrecords a detected deposit/withdrawal for Manager awareness — idempotent onfund_transaction_id— and never calls theCapitalController, so a deposit does not increase the tradeable capital pool (CapitalState.capital_poolis a write-once manifest ceiling with no runtime mutator).ReconciliationHandlerapplies the account's configured response to a mismatch - Add per-account
reconciliation_mismatch_responsetoManifest—HALT,REDUCE_ONLY, orALERT_ONLY— defaulting toHALT(fail-safe: an unconfigured account halts on a balance divergence rather than trading through it) - Add a REDUCE_ONLY hold path to
ModeController. A newReduceOnlyHoldsstructure carries the reconciliation reduce-only hold, arbitrated in_recommitas HALT outranks REDUCE_ONLY outranks the health-derived mode; areconciliation_holdis added toOperationalHoldsfor the HALT response, with a'reconciliation'mode trigger. Both new holds persist through the WAL codec with a backward-compatible decode (a pre-field snapshot defaults them inactive).set_reconciliation_halt/set_reconciliation_reduce_only(and their clears) place and lift them
v0.73.0 on 16th of August, 2026
Add
- Add
BracketProtectionFailureResponse—FLATTEN_THEN_HALTorREDUCE_ONLY— the per-account policy for how an account reacts when a bracket protective-OCO amend leaves the position naked - Add per-account
bracket_protection_failure_responsetoManifest, defaulting toFLATTEN_THEN_HALT(fail-safe: flatten the reconciled remaining position, then halt), sourced alongsidereconciliation_mismatch_responseso a mixed book configures each account independently
v0.74.0 on 16th of August, 2026
Add
- Add a bracket-protection hold to
ModeController. A newprotection_holdonOperationalHoldsand aprotectionreason onReduceOnlyHoldsare arbitrated in_recommitexactly like the reconciliation holds — HALT outranks REDUCE_ONLY outranks the health-derived mode — withset_protection_halt/set_protection_reduce_only(and their clears). Both persist through the WAL codec with a backward-compatible decode (a pre-field snapshot defaults them inactive). The holds are operator-cleared: there is no "protection restored" event, so a subsequent clean cycle does not auto-resume the account - Add the Praxis-side protection-remediation inbound.
ProtectionRemediationmirrors the Praxis signal that a bracket's protective OCO could not be restored and was remediated locally.ProtectionRemediationHandlerapplies the account'sbracket_protection_failure_response:FLATTEN_THEN_HALTdrives the durable HALT hold (Praxis has already flattened),REDUCE_ONLYforces the reduce-only hold, so the operational-mode posture survives a restart
v0.75.0 on 28th of August, 2026
Add
- Add a per-strategy pre-trade price-deviation collar to the validator PRICE stage.
StrategySpec.max_price_deviation_bpslets a strategy creator set a per-strategy deviation cap in bps in the manifest;InstanceConfig.price_deviation_max_bps_by_strategyandPriceStageLimitscarry the per-strategy map, andvalidate_price_stageresolves the effective cap per strategy — a strategy's own cap overrides the account-levelprice_deviation_max_bps, which remains a backward-compatible fallback. The deviation reference is the strategy's own decision price, threaded through asValidationRequestContext.reference_price; a configured strategy that emits no reference price is rejectedPRICE_SYSTEM_DATA_UNAVAILABLE, and an ENTER whose deviation exceeds the cap is rejectedPRICE_DEVIATION_LIMIT. Theorigo_midbook-mid reference source and the ENTER-only scope of the PRICE stage are unchanged
v0.76.0 on 14th of September, 2026
Add
- Add
execution_slippage_bpsandarrival_slippage_bpsto the Praxis-connectorTradeOutcome. Praxis measures the average fill price against the mid it sampled before submission and against the reference price the decision carried, and as of Praxis #172 carries both on its own outcome and persists them; they stopped at the connector because there was nowhere here to put them. Arrival slippage is the measure of the gap between the price a strategy decided against and the price it got, which is this side's question. Both are carried only on fill outcomes, since a measurement describes an execution and an acknowledgement or a rejection has none; a terminal outcome following a partial does not inherit the earlier fill's measurement either, which belongs to thePARTIALthat fill produced. Within a fill they are absent rather than zero when unmeasured, since zero is a real reading — execution landed on the benchmark — and a consumer coalescing absent to zero would read an unmeasured fill as a perfect one. Absence covers a command with no estimate, one with no reference price, and any outcome from a producer that does not measure. Both are signed displacements rather than costs: aSELLfilling below its benchmark reads negative while being the worse outcome, so a negative value is valid and is validated as such, and ranking on the sign inverts one side. This adds the destination fields only — nothing populates them until the companion Praxis translator change forwards the measurements
v0.76.1 on 15th of September, 2026
Fix
- State the scope of
execution_slippage_bpsandarrival_slippage_bpson the Praxis-connectorTradeOutcome. Both are displacements of the command's cumulative average fill price, not of thefill_pricethe carrying outcome reports, and the previous wording said only "the average fill price" — a reader pairing that with the deltafill_pricebeside it would compute increment slippage against the wrong price. Any fill outcome of a command may carry a snapshot, so a consumer wanting one number takes, for each field separately, the latest non-Nonevalue in command order rather than the value on the latest outcome — an outcome carrying none reports that nothing was measured on it, not that an earlier measure was retracted. A snapshot must not be weighted by that outcome'sfill_size, which would count the earlier fills again on every outcome, and successive snapshots cannot be unwound into per-increment slippage, the producer persisting these quotients and not the prices behind them. Documentation only; no behaviour changes
v0.76.2 on 12th of November, 2026
Fix
- Restrict Polars to 1.x to retain the
read_ipc(memory_map=True)calls in the prediction loop.