Developer / Trading decisions

Changelog

Contents

v0.1.0 on 16th of March, 2026

  • Add CI pipeline mirroring Praxis: Ruff, Mypy strict, pytest, CodeQL workflows
  • Add pytest>=8.0 and mypy>=1.10 as dev dependencies
  • Add strict Ruff linting and Mypy configuration in pyproject.toml
  • Add .github/CODEOWNERS with @zero-bang
  • Add nexus/ package with empty __init__.py
  • Add test_placeholder.py with import nexus smoke 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.0 and orjson>=3.10 as runtime dependencies
  • Add observability.py with configure_logging, bind_context, clear_context, get_logger
  • Add instance_config.py with frozen InstanceConfig dataclass (identity + capital ceiling)
  • Add test_observability.py with 10 tests covering JSON output, context binding, level filtering, and stdlib integration
  • Add test_instance_config.py with 7 tests covering creation, immutability, and validation
  • Add nexus-journals/ to .gitignore
  • Wire nexus/__init__.py public API exports

v0.3.0 on 17th of March, 2026

  • Add capital_state.py with mutable CapitalState dataclass and derived available property
  • Add enums.py with OperationalMode, OrderSide, BreachLevel
  • Add instance_state.py composing all state with from_config factory
  • Add operational_mode.py with ModeState and StrategyModeState (composes ModeState)
  • Add position.py with mutable Position dataclass (trade_id, strategy_id, symbol, side, size, entry_price, unrealized_pnl, pending_exit)
  • Add risk_state.py with RiskState and StrategyRiskState (instance-level losses derived from per-strategy state)
  • Add nexus/core/domain/__init__.py re-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.0 as runtime dependency
  • Add wal_entry.py with WALEntryType enum (SNAPSHOT, STATE_MUTATION, STRATEGY_EVENT) and frozen WALEntry dataclass
  • Add wal_codec.py with explicit per-type serialize_state / deserialize_state for InstanceState via msgpack, codec version embedding
  • Add wal.py with WriteAheadLog — append-only binary log with 8-byte magic header, per-record CRC32 integrity, length-prefixed msgpack records, fsync durability
  • Add snapshot.py with atomic save_snapshot (tmp+rename+fsync, WAL truncation) and load_snapshot
  • Add state_store.py with StateStore facade — manages snapshots/ and wal/ subdirectories, checkpoint, append_mutation, recover via snapshot + WAL replay
  • Add docs/TechnicalDebt.md with 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.py with frozen StrategyEvent dataclass (strategy_id, event_type, realized_pnl, timestamp)
  • Add serialize_event / deserialize_event to wal_codec.py with versioned msgpack format, Decimal-as-string precision
  • Add StateStore.append_event() for writing STRATEGY_EVENT WAL entries alongside STATE_MUTATION entries
  • Add loss_derivation.py with derive_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.py with frozen Reservation dataclass (reservation_id, strategy_id, notional, estimated_fees, created_at, expires_at) and ReservationResult outcome type
  • Add capital_controller.py with thread-safe CapitalController guarding CapitalState behind threading.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) and MAX_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.py with OrderLifecycleState enum (IN_FLIGHT, WORKING) and frozen TrackedOrder dataclass
  • 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, and update_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() and to_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_deployed with finite non-negative validation for per-strategy deployment accounting
  • Add InstanceConfig.capital_pct with allocation validation ((0,100] per strategy, total <= 100)
  • Add CapitalController.compute_strategy_budget() to derive budget from capital_pool and capital_pct, with optional realized P&L auto-compounding
  • Refactor check_and_reserve() to enforce strategy budget from controller-owned deployed state instead of caller-provided strategy_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_deployed with 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/CANCEL across CAPITAL, HEALTH, and PLATFORM_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_rate as optional operator config with strict validation (reject bool/non-int/non-positive values)
  • Update default intake hook wiring to source MAX_ORDER_RATE from InstanceConfig, 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 MODIFY edit-baseline field current_order_notional to ValidationRequestContext with strict finite/non-negative validation
  • Add capital-stage delta semantics for MODIFY: when current_order_notional is provided, reserve only positive deltas and skip reservation for no-op/decrease edits; otherwise reserve full order_notional
  • Add strict lifecycle gate for MODIFY in intake hooks: require modifiable_command_ids, deny when unavailable, and validate command membership against modifiable set
  • Add capital-stage tests for MODIFY increase/decrease/no-op reservation behavior
  • Add pipeline-executor tests for MODIFY increase/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 map book_staleness_max_seconds to max_staleness_ms and wire spread/deviation/source limits into Stage 3
  • Add reference-source identity to price contracts via PriceCheckSnapshot.reference_price_source and PriceStageLimits.reference_price_source with 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.py with STPMode enum (CANCEL_MAKER, CANCEL_TAKER, CANCEL_BOTH) for self-trade prevention
  • Add stp_mode field to InstanceConfig with default CANCEL_TAKER and validation
  • Add trade_command_type.py with TradeCommandType enum (NEW_ORDER, AMEND_ORDER, CANCEL_ORDER)
  • Add trade_command.py with frozen TradeCommand dataclass and command-type-specific validation
  • Add translate.py with translate_to_trade_command() mapping ValidationAction to TradeCommand
  • Add outbound_connector.py with OutboundConnector protocol for Trading sub-system dispatch
  • Enforce translate_to_trade_command guards for allowed decision and non-empty command_id
  • Enforce TradeCommand rejection of side/size for AMEND_ORDER/CANCEL_ORDER command types
  • Enforce robust expires_at computation in tests using timedelta instead of minute replacement
  • 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.py with TradeOutcomeType enum (ACK, PARTIAL, FILLED, REJECTED, EXPIRED, CANCELED)
  • Add trade_outcome.py with frozen TradeOutcome dataclass and outcome-type-specific validation (fill outcomes require actual_fees)
  • Add inbound_connector.py with InboundConnector protocol for receiving outcomes from Trading sub-system
  • Add order_context.py with frozen OrderContext dataclass bridging outcome processing with order metadata (side, trade_id, estimated_fees)
  • Add process_result.py with frozen ProcessResult dataclass for outcome processing results
  • Extend CapitalController.order_fill() with actual_fees parameter and fee reconciliation against fee_reserve
  • Add outcome_processor.py with OutcomeProcessor routing outcomes to Capital Controller lifecycle methods
  • Add position growth with VWAP entry price calculation on entry fills
  • Add position reduction with pending_exit clearing 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 StateStore dependency to OutcomeProcessor for WAL persistence of risk events
  • Compute realized P&L in _reduce_position using side-aware formula: side_multiplier × (fill_price - entry_price) × fill_size where side_multiplier is -1 for shorts
  • Add _update_strategy_risk_state() to update per-strategy strategy_realized_pnl, rolling_loss_24h/7d/30d, and high_water_mark
  • Update instance-level cumulative_realized_pnl triggering recompute_drawdown_metrics() on exit fills
  • Persist StrategyEvent to WAL via StateStore.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.py with frozen StrategySpec dataclass (strategy_id, file, permutation_ids, capital_pct) and frozen Manifest dataclass (capital_pool, strategies)
  • Add load_manifest() to parse YAML manifest files with allocated_capital ceiling validation
  • Add _validate_strategy_files() to verify strategy .py files exist and have valid Python syntax via ast.parse()
  • Add pyyaml>=6.0 runtime 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.py with Strategy ABC defining on_save() → bytes and on_load(bytes) → None lifecycle hooks for state persistence
  • Add loader.py with load_strategy_class() for dynamic import from .py files and instantiate_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.py with StrategyParams frozen dataclass wrapping manifest parameters
  • Add signal.py with Signal frozen dataclass for predictor function output (predictor_fn_id, values dict, timestamp)
  • Add action.py with ActionType enum (ENTER, EXIT, MODIFY, ABORT) and Action frozen dataclass
  • Add context.py with StrategyContext frozen dataclass (positions, capital_available, operational_mode)
  • Extend Strategy ABC with five event callbacks: on_startup, on_signal, on_outcome, on_timer, on_shutdown
  • Wire new types in nexus/strategy/__init__.py public API
  • Add 57 tests covering event dispatch types and Strategy callbacks (772 total)

v0.21.0 on 2nd of April, 2026

  • Add executor.py with StrategyExecutor class wrapping Strategy instance with threading.Lock for serialized callback execution
  • Add runner.py with StrategyRunner class 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 with StartupSequencer and StartupError
  • 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_mode stub (TD-011, always ACTIVE), _dispatch_startup calling 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.py with ShutdownSequencer orchestrating 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 .bin files with atomic tmp+rename pattern
  • Add _final_checkpoint() delegating to StateStore.checkpoint() for final snapshot + WAL truncation
  • Add ShutdownError exception to error.py
  • Add StrategyExecutor.dispatch_save() and StrategyRunner.dispatch_save() for on_save lifecycle dispatch
  • Add InstanceConfig.shutdown_wait_timeout_seconds and shutdown_abort_timeout_seconds for 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.py by 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 initial InstanceState when StateStore.recover() returns None
  • Add strategy_state_path parameter to StartupSequencer for strategy state restoration directory
  • Add _restore_strategy_state() loading .bin files into strategies via dispatch_load() (completes TD-007)
  • Add StateStore.read_events() to read STRATEGY_EVENT entries from WAL
  • Add Strategy.on_event_replay() optional callback with default no-op for event replay during recovery
  • Add StrategyExecutor.dispatch_event_replay() and StrategyRunner.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.py with LifecycleResult dataclass and FailureCategory enum (EXPECTED_MISS, INVARIANT_BREACH) replacing bare bool returns in capital lifecycle methods (TD-003)
  • Refactor CapitalController lifecycle methods (release_reservation, send_order, order_ack, order_reject, order_fill, order_cancel) to return LifecycleResult with classified reason codes
  • Convert OutcomeProcessor invariant breach paths to raise RuntimeError for 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_id in StrategySpec.__post_init__ (TD-017)
  • Add version-dispatched deserialization to WAL codec with _decode_state_v1 routing on embedded _v field (TD-001)
  • Preserve STRATEGY_EVENT WAL entries across checkpoint for rolling loss window recovery (TD-002)
  • Add SensorSpec frozen dataclass for Limen Sensor configuration (experiment_dir, permutation_ids, interval_seconds)
  • Replace StrategySpec.permutation_ids with StrategySpec.sensors: tuple[SensorSpec, ...] and update load_manifest YAML parsing
  • Add vaquum_limen as runtime dependency (installed from git+https://github.com/Vaquum/Limen)
  • Add WiredSensor dataclass and implement _wire_sensors() in StartupSequencer — calls Trainer(experiment_dir).train(permutation_ids) to produce Sensors during startup (TD-009)
  • Add signal_producer.py with produce_signal() for live feature preparation via limen_manifest.prepare_data() and predict-to-Signal translation
  • Add predict_loop.py with PredictLoop timer-based signal generation — per-sensor threading.Timer at interval_seconds calling produce_signal → dispatch_signal
  • Implement _stop_signals() in ShutdownSequencer via PredictLoop.stop() (TD-013)
  • Add praxis_outbound.py with PraxisOutbound sync-to-async bridge — asyncio.run_coroutine_threadsafe for submit_command, register_account, deregister_account, pull_positions
  • Add praxis_inbound.py with PraxisInbound queue-based receive_outcome() consuming from queue.Queue[TradeOutcome]
  • Implement _register_with_trading() and _deregister() via PraxisOutbound (TD-005, TD-012)
  • Wire PraxisOutbound into _submit_actions() for shutdown EXIT/ABORT filtering; actual submission pending Action fields (TD-015, TD-023)
  • Implement _wait_terminal() polling PraxisInbound for terminal outcomes with configurable shutdown_timeout (TD-016)
  • Implement _reconcile_capital() pulling Praxis positions, comparing by trade_id, updating position_notional (TD-006)
  • Split test_manifest.py into test_sensor_spec.py, test_strategy_spec.py, test_manifest.py
  • Add docs/TechnicalDebt.md entries 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 TimerSpec frozen dataclass for strategy timer configuration (timer_id, interval_seconds)
  • Add optional timers field to StrategySpec with duplicate timer_id rejection
  • Update load_manifest YAML parsing for optional timers entries
  • Add timer_loop.py with TimerLoop class — per-strategy threading.Timer scheduling for on_timer callbacks (TD-010)
  • Implement _register_timers() in StartupSequencer — extracts timer specs from manifest (TD-010)
  • Implement _stop_timers() in ShutdownSequencer via TimerLoop.stop() (TD-014)
  • Add health_evaluator.py with HealthEvaluator, HealthSnapshot, and HealthThresholds for three-threshold mode determination (warn/breach/halt) (TD-011)
  • Implement _determine_mode() in StartupSequencer — evaluates health snapshot against thresholds, defaults to ACTIVE when no health data available
  • Replace O(N) dictionary scan in _purge_expired with heapq-based expiry tracking (TD-018)
  • Replace O(N) dictionary scan in make_duplicate_order_hook with collections.deque-based chronological expiry (TD-018)
  • Add docs/TechnicalDebt.md entries 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/ and tests/ to top-of-file (health_evaluator.py, test files for wal_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 require command_id (was trade_id) (TD-023.2)
  • Mirror Praxis enums in order_types.py: ExecutionMode, OrderType, MakerPreference. Retype Action.execution_mode/order_type/maker_preference from free strings to these enums (TD-023.3)
  • Extend TradeCommand with execution_mode, order_type, execution_params, deadline, maker_preference, reference_price; AMEND/CANCEL invariants enforce these are absent. Update translate_to_trade_command to take an Action and populate these on NEW_ORDER (TD-023.3)
  • Wire real fields through PraxisOutbound.send_command: order_type, execution_mode, execution_params, maker_preference, reference_price flow from the TradeCommand instead of placeholder None values (TD-023.4)
  • Add PraxisOutbound.send_abort wrapping Praxis Trading.submit_abort via asyncio.run_coroutine_threadsafe (new submit_abort_fn parameter)
  • Wire ShutdownSequencer._submit_actions: EXIT actions translate through translate_to_trade_command and submit via send_command; ABORT actions submit via send_abort with reason 'shutdown'; returned command_ids stored in _submitted_command_ids. Optional config: InstanceConfig parameter on ShutdownSequencer (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 original shutdown_timeout before giving up. Refactor poll loop into _poll_until_terminal and abort fan-out into _escalate_abort_pending (TD-023.6)
  • Import Praxis-only positions during reconciliation: StartupSequencer._reconcile_capital now constructs a Nexus Position (strategy_id / symbol / side / size / entry_price) and inserts it into instance_state.positions when a Praxis position has no Nexus counterpart, provided required fields are present (TD-024)
  • Add PraxisOutbound.get_health_snapshot(account_id) wrapping Praxis Trading.get_health_snapshot via asyncio.run_coroutine_threadsafe (new get_health_snapshot_fn parameter) (TD-026.1)
  • Add health_loop.py with HealthLoop — periodic timer pulls a HealthSnapshot from a configurable provider, evaluates via HealthEvaluator, and updates instance_state.mode on transition. Provider/evaluator exceptions are logged-and-swallowed; start is idempotent; tick_once() exposed for synchronous callers (TD-026.2)
  • Rename _validate_required_fields to _validate_action_type_requirements in Action (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. Manifest gains required account_id: str and allocated_capital: Decimal fields, with internal validation that capital_pool ≤ allocated_capital. Manifest YAML files must now declare account_id: and allocated_capital: alongside the existing capital_pool: and strategies: blocks
  • BREAKING: Drop the allocated_capital parameter from load_manifest(path); the ceiling is sourced from the manifest itself
  • BREAKING: Drop allocated_capital and account_id constructor parameters from StartupSequencer; both are derived from the loaded manifest at runtime
  • Reorder startup sequence to call _load_manifest first (was step 4); _recover_state, _register_with_trading, and _reconcile_capital all read identity and capital from self._manifest
  • BREAKING: Remove allocated_capital field from InstanceConfig — 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 seeds CapitalState.capital_pool from Manifest.capital_pool (the operational allocation), not Manifest.allocated_capital (the infrastructure ceiling); drops the unused InstanceConfig dependency from nexus.core.domain
  • Update manifest YAML fixtures, direct Manifest(...) constructions, InstanceConfig(...) callers, and InstanceState.fresh(...) callers across all tests
  • Add load_manifest validation tests for missing / invalid / non-positive allocated_capital and for blank account_id

v0.29.0 on 22nd of April, 2026

  • Add action_submit.py with submit_actions(actions, *, strategy_id, config, praxis_outbound, validator, build_context, now) — runtime helper that pushes strategy-emitted actions through ValidationPipeline → translate_to_trade_command → PraxisOutbound.send_command for ENTER/EXIT/MODIFY, and directly through PraxisOutbound.send_abort for ABORT. Returns per-action SubmissionOutcome (SUBMITTED / REJECTED / SUBMIT_FAILED / INVALID) so callers can record Praxis-assigned command_ids (PT.1.1)
  • Wire PredictLoop._tick to forward dispatch_signal return value to an injected action_submit: Callable[[list[Action], str], None] | None callback. Constructor accepts optional action_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._tick the same way — dispatch_timer return value flows through action_submit with identical exception semantics (PT.1.3)
  • Add public StartupSequencer.instance_state and StartupSequencer.manifest properties returning the live InstanceState / loaded Manifest (or None before _load_manifest / _recover_state have run). Returns the actual mutable state object — not a copy — so runtime context_provider callers observe reservations, position changes, and operational-mode transitions made by validator stages and outcome processing (PT.2.1)
  • Add outcome_loop.py with OutcomeLoop(runner, praxis_inbound, state, context_provider, resolve_strategy_id, action_submit=None) — single worker-thread loop polling PraxisInbound.receive_outcome(), resolving command_id → strategy_id via an injected callable, dispatching on_outcome through StrategyRunner, and forwarding any captured list[Action] back through action_submit. Idempotent start()/stop(), tick_once() for test harnesses, exception-absorbent worker (PT.3.1)
  • Extend ShutdownSequencer with optional outcome_loop: OutcomeLoop | None constructor parameter and a new _stop_outcome_loop() step invoked after _stop_timers() and before _wait_terminal(). OutcomeLoop and _wait_terminal both consume from the same PraxisInbound queue, 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 new TestStopOutcomeLoop class in test_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.3 in pyproject.toml so the Nexus and Praxis venvs converge on a single Limen release; without a version constraint the two venvs drifted (vaquum_limen 1.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's Trainer (PT-FIX-4)
  • Add optional process_outcome: Callable[[TradeOutcome], None] | None parameter to OutcomeLoop; the launcher uses it to apply venue-lifecycle effects to CapitalController via OutcomeProcessor.process(...) before runner.dispatch_outcome runs, 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 Trainer per resolved experiment_dir inside StartupSequencer._wire_sensors; subsequent Trainer constructions for the same directory receive data=cached._data so 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.py verifying 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 reason INTAKE_MODE_BLOCKS_ENTER when state.mode.mode != OperationalMode.ACTIVE, and EXIT/MODIFY actions are rejected with INTAKE_MODE_HALTED_BLOCKS_TRADING when 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 where HealthLoop flipped state.mode to 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] | None constructor parameter and a _pending_startup_actions buffer to StartupSequencer. _dispatch_startup now forwards via the constructor-injected submitter when available; otherwise it stashes per-strategy actions for the launcher to drain via the new public drain_pending_startup_actions(submitter) method (idempotent, per-strategy exception-safe). Closes the gap where strategy on_startup recovery 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. Switch StateStore.__init__, StateStore.recover, StateStore.read_events, and WriteAheadLog.truncate_keeping_events to consume the safe variant so a process killed mid-append no longer blocks the next boot or checkpoint. read_all retains strict raise-on-corruption semantics for callers that want it. Add WriteAheadLog.validate_magic() and call it from StateStore.__init__ so a non-WAL/garbage file fails loud at boot rather than at the first runtime append(). The torn record itself is unrecoverable and stays discarded; the file is cleaned up by the next append() via existing self-truncation (PT-FIX-17)
  • Soften StartupSequencer._wire_sensors so 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), and test_wire_sensors_isolation.py (4 new isolation cases) (1098 total)

v0.32.0 on 26th of April, 2026

  • Add _halt_state_mode as the first step of ShutdownSequencer.shutdown(); flips state.mode to OperationalMode.HALTED before any loop is stopped so any in-flight outcome dispatch's downstream ENTER is rejected by the validator's _check_operational_mode stage instead of leaking past _dispatch_shutdown to the venue (PT-FIX-25)
  • Default StartupSequencer._determine_mode to OperationalMode.REDUCE_ONLY when no health_snapshot is wired at boot, instead of the prior ACTIVE. Mirrors the resolved mode into state.mode so the validator's _check_operational_mode stage sees the same value the sequencer carries into StrategyContext. Closes the ~5 s permissive window where strategies' on_startup ENTERs reached the venue before the first HealthLoop tick had landed (PT-FIX-26)
  • Add bridge_to_capital(controller, outcome) helper that invokes CapitalController.send_order(reservation_id, command_id) for SUBMITTED outcomes carrying a reservation. Document the outcome.command_id ↔ CapitalController.send_order(order_id=...) contract on OutcomeProcessor.process so a name swap is caught at review. Without this wiring, every ACK/FILL outcome returned INVARIANT_BREACH: order not found silently (PT-FIX-27)
  • Add outcome_processor: OutcomeProcessor | None constructor parameter and _apply_terminal_outcome helper to ShutdownSequencer; _submit_exit now builds and stores an OrderContext per command, and _poll_until_terminal routes FILLED outcomes through OutcomeProcessor.process so shutdown EXIT fills decrement state.positions[trade_id].size correctly. 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.RISK to 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_ZERO check in validate_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_sensors so a manifest declaring zero sensor specs raises StartupError('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 stranded reservation_notional / in_flight_order_notional / working_order_notional aggregates carried over from a crashed prior boot, and rebuilds per_strategy_deployed from the live positions so it sums to position_notional exactly. The launcher calls this after constructing CapitalController. 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_context with .get() + explicit ValueError so a position removed by a concurrent OutcomeLoop tick during shutdown does not propagate KeyError past the surrounding try/except ValueError (PT-FIX-36)
  • Add ValidationStage.PRICE to the EXIT/ABORT/CANCEL bypass set, completing the rule "any stage gating new exposure must not block exits". Pre-fix PRICE_BOOK_STALE and PRICE_SPREAD_LIMIT denials 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_outcome in _poll_until_terminal so a partial fill on a shutdown EXIT followed by a CANCELED/EXPIRED terminal still decrements state.positions[trade_id].size. Pre-fix the partial-fill amount was silently lost (PT-FIX-38)
  • Accept OrderLifecycleState.WORKING (in addition to IN_FLIGHT) in CapitalController.order_reject so a venue REJECTED outcome racing past an ACK releases working_order_notional instead 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 _running under _lock inside HealthLoop._apply_snapshot before writing state.mode, so a tick already past the top-level _running guard cannot overwrite the PT-FIX-25 HALTED ratchet after stop() returned. New respect_running: bool = True parameter; tick_once() passes False for 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 releases in_flight_order_notional instead of leaving capital parked (PT-FIX-43)
  • Add non_pending_outcome_handler: Callable[[TradeOutcome], None] | None constructor parameter to ShutdownSequencer. _poll_until_terminal now routes outcomes whose command_id is NOT in the shutdown's pending set through the handler (the launcher passes its process_outcome closure) instead of silently discarding them with continue. Pre-fix pre-shutdown ENTER FILLEDs that arrived after _stop_outcome_loop were 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 <= _ZERO now raises ValueError instead of silently assigning action.size (base-asset units) into the notional slot (quote-asset units). The branch is unreachable under current Position invariants but the prior fallback would have constructed an OrderContext with garbage if it ever fired
  • Add structured logs to each early-return in bridge_to_capital — debug for routine cases (REJECTED/SUBMIT_FAILED status, no reservation on EXIT/MODIFY), warning for the unexpected case (SUBMITTED outcome with no command_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 across TestShutdownSequence, TestShutdownExitAppliesToState, TestSubmitExitMissingPositionRace, TestShutdownExitPartialFill, TestNonPendingOutcomeHandler), test_capital_controller.py (16 new across TestReconcileAtBoot, TestReconcileAtBootRebuildsPerStrategyDeployed, TestOrderReject, TestOrderCancel), test_outcome_processor.py (2 new in TestOutcomeProcessorReject and TestOutcomeProcessorCancel), test_validator_pipeline_executor.py (20 new safety-bypass / PRICE-bypass / TestSafetyBypassContract tests), 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), and test_action_submit.py (4 new in TestBridgeToCapital). Total Nexus tests: 1182
  • Add docs/TechnicalDebt.md entries TD-027 (bare assert in OutcomeProcessor fill handlers, fires under python -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_position defensive gap on trade_id=None), TD-030 (_poll_until_terminal misleading double-dispatch structure), TD-031 (PraxisOutbound trade_id/command_id contract not asserted), TD-032 (on_startup capital_available shows gross budget, not net of deployed), TD-033 (multi-process WAL TOCTOU between StateStore.__init__ and recover())

v0.33.0 on 29th of April, 2026

  • Add required avg_cost_basis: Decimal field to Position — VWAP-with-fees cost per unit, maintained by OutcomeProcessor._grow_position on every entry FILL. WAL codec encodes the new field; legacy snapshots without it decode to entry_price (best-effort default — fees lost). Praxis-imported positions in StartupSequencer._import_praxis_position initialize the same way (BLOCKER-A.1)
  • Add CapitalController.order_exit(strategy_id, cost_basis_released) lifecycle method that decrements position_notional and per_strategy_deployed[strategy_id] by the released cost basis, with INVARIANT_BREACH guard against driving position_notional negative. Mirrors order_fill for the EXIT direction (BLOCKER-A.1)
  • Wire EXIT FILL through order_exit in OutcomeProcessor._handle_fill — when not context.is_entry, call order_exit before _update_position_on_fill() / _reduce_position() so capital aggregates are decremented by position.avg_cost_basis * fill_size without mutating positions on INVARIANT_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 asserted success and realized_pnl but never state.capital.position_notional or per_strategy_deployed (BLOCKER-A.3)
  • Add pending_exit increment in submit_actions — for EXIT actions with status SUBMITTED, after praxis_outbound.send_command returns, state.positions[action.trade_id].pending_exit += ctx.order_size (matches the size that translate_to_trade_command(... size=context.order_size ...) actually submitted, so the validator's INTAKE_EXIT_SIZE_EXCEEDS_REMAINING defense compares like-with-like). Defensive is None guards against missing position. The defense at intake_stage.py:248-256 was structurally unreachable pre-fix because the field was decremented in 4 sites and incremented nowhere — strategies could submit two overlapping EXITs each sized at position.size, the second oversold and crashed _reduce_position. Eleven audit rounds missed this because the existing intake-stage test pre-populated pending_exit=0.2 directly in setup (BLOCKER-C)
  • Replace the warn-only "position in Nexus but not in Praxis" loop in StartupSequencer._reconcile_capital with an eviction loop that pops every Nexus-only trade_id and logs at WARNING with the strategy_id / size / entry_price. Closes the recovery path that left per_strategy_deployed rebuilt 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 (TestOutcomeProcessorReject EXIT 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 in TestCapitalConservationOnExit — 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_basis invariants), test_wal_codec.py (1 round-trip + 1 legacy decode), test_startup_sequencer.py (3 — Nexus-only eviction, both-present regression, mixed scenario), and test_action_submit.py (6 in TestPendingExitIncrement — increment on SUBMITTED, no-increment on REJECT/SUBMIT_FAILED/ENTER/missing-trade_id, cross-tick overlap denial via real validate_intake_stage). Total Nexus tests: 1199
  • Replace silent-None sentinel on zero avg_cost_basis in OutcomeProcessor._reduce_position with an explicit if position.avg_cost_basis == _ZERO check + WARNING log naming the trade_id / fill_size / entry_price. Pre-fix cost_basis_released if cost_basis_released > _ZERO else None silently 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_basis on outcome.fill_size > position.size — return None so order_exit is skipped before _reduce_position raises RuntimeError. Pre-fix capital was already decremented by position.avg_cost_basis * fill_size at the time of the raise, leaving CapitalState divergent from positions (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_basis on position.strategy_id != context.strategy_id — return None and log WARNING. Pre-fix a context wired to a different strategy than the position's owner would decrement the wrong per_strategy_deployed bucket → attribution drift / underflow on the owning strategy
  • Update _compute_exit_cost_basis docstring 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_exit docstring — exit fees are NOT touched here AND are NOT deducted from realized_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 the avg_cost_basis == _ZERO WARNING text to reflect that reconcile_at_boot can no longer recover this case (it now rebuilds from pos.avg_cost_basis directly), and add position_size / position_avg_cost_basis to the extra context for incident response (Copilot PR #47 review)
  • In StartupSequencer._reconcile_capital, set nexus_pos.size = qty after the size-mismatch warning — Praxis is the live truth post-WS-applied state. Pre-fix position_notional (Praxis qty) and downstream per_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 from nexus_pos.avg_cost_basis == _ZERO to the Praxis avg_entry_price (or nexus_pos.entry_price if Praxis price is also zero) so position_notional stays in the right ballpark and order_exit does not fire INVARIANT_BREACH on the next EXIT fill for legacy snapshot positions (Copilot PR #47 review)
  • Persist the fallback price onto nexus_pos.avg_cost_basis in _reconcile_capital so downstream reconcile_at_boot and _compute_exit_cost_basis see a consistent non-zero cost basis (Copilot PR #47 review)
  • In CapitalController.reconcile_at_boot, apply the same avg_cost_basis == _ZERO fallback to entry_price (with WARNING) when rebuilding per_strategy_deployed, so a Position whose avg_cost_basis was never repopulated does not under-attribute deployed capital and immediately re-trigger the attribution-mismatch denial (Copilot PR #47 review)
  • Switch submit_actions pending_exit increment from action.size to ctx.order_size — the latter is what translate_to_trade_command(... size=context.order_size ...) actually sends. If build_context rounds or clamps the size away from action.size, pending_exit now matches what was validated and submitted, keeping the INTAKE_EXIT_SIZE_EXCEEDS_REMAINING defense reliable (Copilot PR #47 review)
  • Add per_strategy_deployed[strategy_id] guard in CapitalController.order_exit — return INVARIANT_BREACH when cost_basis_released exceeds the per-strategy bucket, before the global position_notional check would have allowed the mutation. Pre-fix only position_notional was checked; a missing or stale per-strategy entry could be driven negative (or dropped via _adjust_strategy_deployed), leaving position_notional decremented while attribution was corrupted, and the next check_and_reserve would fire the attribution-mismatch denial with no recovery path until reboot (Copilot PR #47 review)
  • Add docs/TechnicalDebt.md entries TD-040 (WAL codec back-compat: legacy snapshot decodes avg_cost_basis from entry_price, losing entry-fee portion of cost basis until positions cycle through fresh ENTER FILLs) and TD-041 (pending_exit increment in submit_actions lacks lock protection symmetric with the existing unlocked decrement sites in OutcomeProcessor; 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 = None field to TradeCommand — wired through PraxisOutbound.send_command into Praxis's Trading.submit_command(strategy_id=...) kwarg. NEW_ORDER carries the owner; AMEND_ORDER and CANCEL_ORDER reject strategy_id is not None. Closes the TD-E missing-kwarg root cause that left every Praxis Position with strategy_id=None (MAJOR-O + TD-E)
  • Skip qty * price contribution to praxis_total_notional in StartupSequencer._reconcile_capital when _import_praxis_position returns None — pre-fix the position was dropped from state.positions but its notional still inflated position_notional; downstream reconcile_at_boot rebuilt per_strategy_deployed only from state.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_capital post-fix (MAJOR-O)
  • Add positions_lock: threading.Lock | None kwarg to OutcomeProcessor.__init__ — _grow_position and _reduce_position wrap their state.positions field-assignment + del blocks under it (nullcontext when 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 into OutcomeProcessor's writer path — a concurrent PredictLoop iteration of state.positions.values() could fire RuntimeError: dictionary changed size during iteration, swallowed by PredictLoop's top-level except → silently dropped strategy ticks (MAJOR-J + TD-U)
  • Bump DEFAULT_TTL_SECONDS from 30 to 60 in CapitalController so the reservation TTL exceeds the praxis_outbound._DEFAULT_TIMEOUT (30s). Pre-fix a slow send_command returning at t == ttl was followed by send_order's _purge_expired removing the reservation; the pop returned None → EXPECTED_MISS → OrderContext never registered → capital permanently stuck in in_flight_order_notional (MAJOR-K)
  • Reorder CapitalController.send_order — _reservations.pop now runs FIRST, then an explicit now > reservation.expires_at check (with capital release on truly-past), then _purge_expired for 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.process in ShutdownSequencer._apply_terminal_outcome. Pre-fix the early-return on not is_fill left position.pending_exit non-zero (incremented at submit_actions time); the persisted Position then denied the next boot's first EXIT with INTAKE_EXIT_SIZE_EXCEEDS_REMAINING. Post-fix _handle_reject / _handle_cancel (with context.is_exit=True) invoke _clear_pending_exit (MAJOR-I + TD-N)
  • Add pending_exit += context.order_size increment in ShutdownSequencer._submit_exit after send_command succeeds, mirroring submit_actions. Pre-fix the asymmetry meant a multi-EXIT shutdown for the same trade_id skipped the INTAKE_EXIT_SIZE_EXCEEDS_REMAINING defense and _clear_pending_exit (now wired via MAJOR-I) had no inflated value to clear (MAJOR-L)
  • Reset position.pending_exit = _ZERO for every persisted Position in CapitalController.reconcile_at_boot with WARN if non-zero. In-memory _orders is empty post-boot so nothing should still be in flight; the pre-fix stuck value would deny future EXITs via INTAKE_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_MISMATCH denial in intake_stage — EXIT context's strategy_id must match the position owner's strategy_id. Pre-fix intake validated only trade_id ∈ state.positions; on cross-strategy EXIT capital was correctly skipped (via _compute_exit_cost_basis strategy_id guard) but _reduce_position still ran (decrementing position) and _update_strategy_risk_state attributed realized P&L to the WRONG strategy bucket — corrupting rolling_loss_* and high_water_mark on the non-owner (MAJOR-Q)
  • Wire release_reservation rollback into submit_actions — accepts optional capital_controller kwarg; on translate / send_command exception, _release_granted_reservation invokes controller.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 the release_reservation-defined-but-unwired gap that the round-12 audit caught (MAJOR-G)
  • Add positions_lock kwarg to ShutdownSequencer.__init__; _dispatch_shutdown snapshots state.positions.values() under it once per call (filtering by strategy_id after release). Adds an early WARNING when outcome_loop.running indicates the join-timeout fired. Pre-fix a _stop_outcome_loop join timeout could leave the OutcomeLoop mutating positions; the unlocked iteration would fire RuntimeError: dictionary changed size during iteration, escape the per-strategy try/except, and terminate shutdown before _persist_strategy_state / _final_checkpoint ran — data loss (MAJOR-S)
  • Subtract state.capital.per_strategy_deployed.get(strategy_id, _ZERO) from gross budget in ShutdownSequencer._dispatch_shutdown so StrategyContext.capital_available mirrors runtime's _build_strategy_context. Pre-fix shutdown surfaced the gross strategy budget; strategies that branched on capital_available in on_shutdown saw an overstated value (MAJOR-T)
  • Enforce rolling_loss_24h/7d/30d limits in evaluate_risk_breach — RiskStageLimits gains max_rolling_loss_24h/7d/30d fields; RiskCheckMetrics extended with the rolling-loss values; to_risk_check_metrics populates them. Wire state_store.refresh_rolling_losses into HealthLoop via optional rolling_loss_refresher kwarg so 24h/7d/30d windows decay as old loss events age out. Pre-fix the fields were tracked, persisted via WAL codec, and refresh_rolling_losses existed for decay but no validator stage read them and refresh_rolling_losses had zero production callers (MAJOR-H)
  • Pre-bind OutcomeProcessor._positions_cm in __init__ to either the lock or nullcontext() so _grow_position and _reduce_position use a single readable with 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.md entries TD-042 through TD-051 — defer round-12/13/14 audit findings that are not paper-trade-fatal (MODIFY validator-bypass set, _clear_pending_exit clamp diagnostic, pending_exit durability, _handle_ack false-positive WARN, _handle_cancel remaining_size=None over-clear, _handle_reject EXIT-reject WARN, _handle_fill post-success exception path, _purge_expired periodic invocation, bridge_to_capital helper unused by production launcher, realized_pnl exit-fee accounting)

v0.35.0 on 1st of May, 2026

  • Add max_allocation_per_trade_pct: Decimal keyword-only argument to CapitalController.__init__ — defaults to module constant MAX_ALLOCATION_PER_TRADE_PCT (Decimal('0.15')) so prior callers are unchanged. The per-trade allocation gate at check_and_reserve now 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, positive Decimal (rejects non-Decimal, non-finite NaN / ±Infinity, zero, and negative values)
  • Add ten tests in test_capital_controller.py under TestMaxAllocationPerTradePctOverride covering 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 = 1 keyword-only argument to produce_signal — default 1 preserves prior tail(1) behaviour bit-for-bit; lookback=N feeds the last N prepared rows into sensor.predict. Caller-side validation raises TypeError on non-int / bool and ValueError on values < 1
  • Fix dtype preservation in _extract_values — multi-element-array branch previously cast val[-1] to float unconditionally, demoting _preds from int to float for 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 TestLookback class (7 tests) and three TestExtractValues tests in test_signal_producer.py; update existing test_multi_element_array_takes_last to 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's process_outcome hits the no-OrderContext terminal cleanup branch, the helper releases the orphan order's capital aggregates (mirrors order_reject / order_cancel per-state release without requiring OrderContext). Idempotent. Position growth from FILL outcomes is intentionally NOT performed; aggregate release is the priority and the next boot's _reconcile_capital adopts Praxis truth for position state. No production caller yet — Praxis follow-up tracked as TD-067
  • Add CapitalController.lock_cm returning the internal _lock so callers like ShutdownSequencer._final_checkpoint can serialise reads of state.capital.per_strategy_deployed and the aggregate fields atomically with respect to in-flight controller mutations (FINAL-MAJOR-05)
  • Add RiskState.lock dataclass field (init=False, repr=False, compare=False) and RiskState.lock_cm helper that returns the lock as a context manager (or nullcontext() when unset) so the OutcomeProcessor writer, HealthLoop refresher, and validator reader coordinate on the same lock instance, consistent with the dataclasses.replace() behavior covered by tests (FINAL-MAJOR-02)
  • Add derive_strategy_realized_pnl that sums signed cumulative realized_pnl per strategy from WAL events; called by state_store.recover() so a crash between append_event and append_mutation does not leave strategy_realized_pnl permanently understated and drawdown gates stale (FINAL-TD-01)
  • Add _dedup_by_outcome_id filter helper in loss_derivation.py shared by derive_rolling_losses and derive_strategy_realized_pnl so 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 to StrategyEvent; WAL event codec bumped to v2 with the new field; v1 payloads decode to outcome_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 in capital_controller.py shared by order_exit (FINAL-MAJOR-06) and order_fill (FINAL-MAJOR-09); absorbs sub-ULP rounding noise without weakening the underlying invariants
  • Add _wal_lock to StateStore wrapping append_mutation, append_event, AND checkpoint (snapshot+truncate) as one atomic critical section so concurrent writers from OutcomeLoop and shutdown thread cannot produce duplicate _sequence records or torn appends (FINAL-MAJOR-04)
  • Add positions_lock parameter to submit_actions so the EXIT position.pending_exit += ctx.order_size write at line ~250 runs under the lock; closes the lost-update race with the OutcomeProcessor decrementer (FINAL-MAJOR-03)
  • Add capital_controller parameter to ShutdownSequencer.__init__; _final_checkpoint now wraps the checkpoint call in positions_lock + CapitalController.lock_cm() so a still-alive OutcomeLoop after _stop_outcome_loop join_timeout cannot race the snapshot serializer's iteration of state.positions, state.risk.per_strategy, or state.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.md covering 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 promoting RiskState.lock to a proper dataclass field

Fix

  • Fix state.risk.per_strategy cross-thread access. Pre-fix the OutcomeLoop writer, HealthLoop refresher, validator's to_risk_check_metrics reader, and the WAL serializer iterated/mutated the dict without coordination — a fresh-strategy insert during property iteration raised RuntimeError: dictionary changed size during iteration, silently swallowed by HealthLoop and breaking rolling-loss decay. Post-fix all four call sites coordinate on state.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's INTAKE_EXIT_SIZE_EXCEEDS_REMAINING defense within the same tick (FINAL-MAJOR-03)
  • Fix WAL append atomicity. Pre-fix _sequence += 1 (a 2-bytecode read-modify-write) and WAL.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. checkpoint now also runs under the same lock so snapshot+truncate is atomic with appends (FINAL-MAJOR-04)
  • Fix _final_checkpoint serializer iteration race on shutdown thread. Pre-fix serialize_state iterated state.positions, state.risk.per_strategy, state.capital.per_strategy_deployed, and read CapitalState aggregates without any lock — a still-alive OutcomeLoop worker after _stop_outcome_loop join_timeout could trigger RuntimeError: dictionary changed size during iteration and lose the persisted shutdown HALTED mode. Post-fix wraps the call in positions_lock + CapitalController.lock_cm() (FINAL-MAJOR-05)
  • Fix order_exit strict > boundary trip on sub-ULP overshoots from _compute_exit_cost_basis's (N/q) * q round-trip. Verified single-fill repro (q=Decimal('3'), N=Decimal('5')) produces 5.000...001 > 5 at default Decimal precision; pre-fix returned INVARIANT_BREACH and 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 via min() so position_notional and per_strategy_deployed never go negative (FINAL-MAJOR-06)
  • Fix _reduce_position to subtract outcome.actual_fees from realized_pnl. Pre-fix returned GROSS realized_pnl that flowed verbatim into strategy_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 testnet fee_rate=0 so unobserved at MMVP today; mainnet-fatal once fee_rate flips non-zero. Post-fix the entire risk derivation chain reflects NET PnL (FINAL-MAJOR-08)
  • Harden order_fill fee-deficit check against sub-ULP precision drift between proportional_estimated (computed via subtraction round-trip) and actual_fees (computed via direct division). On awkward notional/fee ratios (e.g. notional=7, fee=1) the deficit can accumulate sub-ULP and trip EXPECTED_MISS cosmetically. Post-fix uses _SUB_ULP_TOLERANCE on the deficit check; real deficits (>1E-12 quote) still hard-fail. NOTE: the audit finding labeled FINAL-MAJOR-09 (cumulative attribution drift via pre_fill_remaining - updated.remaining_total feeding working_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 the order_exit boundary trip closed by FINAL-MAJOR-06's _EXIT_BOUNDARY_TOLERANCE clamp. TestFinalMajor09OrderFillAttributionLockstep PINS the empirical lockstep so a future arithmetic refactor cannot regress it (FINAL-MAJOR-09)
  • Fix state_store.recover() to always re-derive rolling_loss_* against current time — pre-fix early-returned when WAL had zero events, leaving snapshot's stale rolling_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-derive strategy_realized_pnl, cumulative_realized_pnl, and high_water_mark from STRATEGY_EVENT entries — pre-fix only rolling_loss_* was re-derived; on a crash between append_event and append_mutation the 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_losses and derive_strategy_realized_pnl to deduplicate events by outcome_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. Empty outcome_id (legacy v1-codec events) is NOT deduped — preserves the legacy WAL contract (FINAL-TD-02)

Update

  • Update CapitalController.order_exit docstring to reflect the new net-of-fee realized_pnl semantics: exit fees ARE deducted from realized_pnl at the source in _reduce_position, so strategy_realized_pnl, cumulative_realized_pnl, equity, and rolling-loss windows all reflect NET PnL
  • Update docs/TechnicalDebt.md to reflect actual deferred status of TD-057, TD-058, TD-066 — initial entries claimed transitive closure by FINAL-MAJOR-02, but the M02 implementation scoped state.risk.lock to the risk dict only and did not extend positions_lock coverage to the cited call sites
  • Update pyproject.toml version 0.36.0 → 0.37.0

v0.38.0 on 3rd of May, 2026

Add

  • Add _processed_outcome_ids set + _dedup_lock to OutcomeProcessor; process(outcome, context) returns success no-op on a repeated outcome.outcome_id so 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 via OutcomeAcked filtering at boot (round-18 MAJOR-004)
  • Add 4 deferred-finding entries (TD-083, TD-084, TD-085, TD-086) to docs/TechnicalDebt.md covering the OutcomeProcessor dedup lock TOCTOU contract and the unbounded _processed_outcome_ids set growth surfaced during pre-PR review, the submit_actions validator-exception leak path raised in PR #57 review, and the dedup-after-mutation defect in _handle_fill (capital/position mutated before append_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.md covering: missing end-to-end rolling-loss enforcement test (TD-076); persisted HALTED mode overwritten by HealthLoop after restart (TD-077); boot reconciliation keeps stale avg_cost_basis (TD-078); no architectural guard against direct PraxisOutbound.send_command callers (TD-079); shutdown does not guarantee _final_checkpoint if an earlier step raises (TD-080); _persist_strategy_state and _final_checkpoint block on disk fsync without timeout (TD-081); validator's platform_limits_stage lacks 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 to TestRecoverOrphanedOrder (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_actions REJECTED branch leaking the granted Reservation when a post-CAPITAL validator stage (HEALTH or PLATFORM_LIMITS) denies the action. Validator stage order is INTAKE → RISK → PRICE → CAPITAL → HEALTH → PLATFORM_LIMITS; Pipeline.validate re-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 _reservations until 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-only Strategy driven by a binary classifier signal: ENTER on _preds == 1, EXIT on _preds == 0, single concurrent position. MARKET orders via ExecutionMode.SINGLE_SHOT, 10% capital fraction per ENTER, 60s execution deadline. All other lifecycle hooks are no-ops. Reference price is read from signal.get('close'); the strategy returns no action when the signal payload lacks a price or the price is not finite-positive. _preds payloads 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 at permutation_ids: [21] from a BtcLogRegEVSFD 5000-permutation Limen run with interval_seconds: 7200 and capital_pct: 100. Manifest references the strategy file as strategies/logreg_binary_evsfd.py (relative to the manifest's parent directory, which load_manifest validates against). Placeholder account_id, allocated_capital, capital_pool, and sensors[].experiment path 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), the experiment_dir= + search_strategy= constructor requirement on UniversalExperimentLoop, the importable-SFD-module requirement (metadata.json[sfd_module] is reloaded by Trainer via importlib.import_module() so the SFD class must not live in __main__), and the 3-step deploy procedure for the launcher's MANIFESTS_DIR and STRATEGIES_BASE_PATH

v0.40.0 on 5th of May, 2026

Add

  • Add tests/test_limen_trainer_contract.py — 10 tests pinning the Limen Trainer integration contract Nexus depends on. TestTrainerInitContract: parameter names, experiment_dir is required + accepts positional, data defaults to None + accepts keyword. TestTrainerTrainContract: parameter names, permutation_ids accepts positional, return type via typing.get_type_hints (robust to from __future__ import annotations). TestTrainerPrivateAttributeContract: Trainer.__init__ source contains self._data and self._manifest assignments — pins the private-attribute reads at nexus/startup/sequencer.py:634, 655. A future vaquum_limen bump that reshapes any of these now fails CI loudly instead of breaking at deploy time

Update

  • Bump vaquum_limen git+https pin from v2.4.3 to v3.0.1. Limen v3 introduced a Manifest API rename (RFC-1004) and a class-based limen.targets module replacing the v2 function-based target builders; Nexus production code only imports from limen.experiment.trainer.trainer import Trainer (nexus/startup/sequencer.py:15), and the Trainer.__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. the BtcLogRegEVSFD example) must be re-trained against v3 limen via experiment_runner before deploy; the bundle re-train is upstream and decoupled from this pin bump
  • Update vaquum_limen 2.4.3 → vaquum_limen 3.0.1 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v3.0.1 Trainer class (verified via inspect.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 → optional action_submit) without requiring start() and without scheduling a follow-up threading.Timer. The _running guard takes _lock so the check is atomic with start()/stop() (and raises RuntimeError when the Timer-driven loop is active); the chain body runs without the lock, so callers must not invoke start() mid-tick. Propagates exceptions from the chain to the caller instead of swallowing them as _tick does — schedule drivers decide how to handle failures rather than relying on a worker log. Mirrors the tick_once() shape already exposed by OutcomeLoop and HealthLoop. Pure addition: no existing line in predict_loop.py was modified, all 9 existing test_predict_loop.py tests 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 without start(), no follow-up Timer scheduling, RuntimeError guard 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 _tick and tick_once invoke the chain steps _extract_kline_size → _market_data_provider → produce_signal → _context_provider → dispatch_signal → _action_submit in that order via inspect.getsource, and a real runtime parity test (test_chain_invoked_in_same_order_as_tick) that drives both _tick (with _running flipped manually and _schedule_locked patched to a no-op so it does not reschedule) and tick_once against identical tracking providers, asserting their recorded event lists match byte-for-byte

v0.42.0 on 6th of May, 2026

Update

  • Bump vaquum_limen git+https pin from v3.0.1 to v3.0.3. Limen v3.0.3 (Vaquum/Limen#500) makes Trainer.__init__ hermetic per-experiment: the SFD module named by metadata.json["sfd_module"] is now loaded by preferring a <sfd_module>.py file inside experiment_dir (via importlib.util.spec_from_file_location + module_from_spec, no sys.path mutation) before falling back to importlib.import_module. Nexus production code only imports from limen.experiment.trainer.trainer import Trainer (nexus/startup/sequencer.py:15), and the public Trainer.__init__(experiment_dir, data=None) + Trainer.train(permutation_ids: list[int]) signatures are unchanged in v3.0.3 (verified by tests/test_limen_trainer_contract.py — all 10 contract tests pass against v3.0.3 unmodified). Unblocks the Praxis paper-trade BtcLogRegEVSFD deploy where the SFD .py produced by trainer_prep.py lives inside the staged experiment_dir but is referenced by a bare module name in metadata.json — under v3.0.1 this path raised ModuleNotFoundError because the experiment_dir was not on sys.path; under v3.0.3 the local-file branch loads it directly with no operator-side PYTHONPATH wiring required
  • Update examples/README.md SFD-module guidance to describe Limen v3.0.3's two-stage load (local <sfd_module>.py inside experiment_dir is 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 of BtcLogRegEVSFD-style experiment_dir bundles into unnecessary deploy-time PYTHONPATH wiring
  • Update vaquum_limen 3.0.1 → vaquum_limen 3.0.3 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v3.0.3 Trainer class (verified via inspect.getsource(Trainer.__init__)) so the re-validate-on-upgrade contract is satisfied

v0.43.0 on 7th of May, 2026

Update

  • Bump vaquum_limen git+https pin from v3.0.3 to v3.0.5 (Vaquum/Limen#505). Limen v3.0.5 fixes the experiment-local SFD load to register the loaded module in sys.modules (with rollback on exec_module failure) so downstream importlib.import_module(architecture_function.__module__) lookups (notably Limen's own Trainer._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) reached Trainer.__init__ cleanly but failed at train() → _resolve_model_class() with ModuleNotFoundError. Nexus production code only imports from limen.experiment.trainer.trainer import Trainer (nexus/startup/sequencer.py:15); the public Trainer.__init__(experiment_dir, data=None) + Trainer.train(permutation_ids: list[int]) signatures are unchanged in v3.0.5 (verified by tests/test_limen_trainer_contract.py — all 10 contract tests pass against v3.0.5 unmodified). Unblocks the Praxis paper-trade BtcLogRegEVSFD deploy at the _resolve_model_class path; 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.5 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v3.0.5 Trainer class so the re-validate-on-upgrade contract is satisfied

v0.44.0 on 9th of May, 2026

Fix

  • Fix produce_signal to pass the last lookback rows to sensor.predict as a polars.DataFrame instead of numpy.ndarray. Previously signal_producer.py called x_train.tail(lookback).to_numpy() which discarded column names. SFDs that defend against feature-shape drift by selecting _model_columns from the live frame at predict time (e.g. the BtcLogRegEVSFD bundle, which records self.model_cols at fit time and calls frame.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 check x.shape[1] == len(self.training_feature_columns) (80 != 78) skipped the index-based slice and forwarded all 80 columns to LogisticRegression.predict_proba which expected 77, raising ValueError: X has 80 features, but LogisticRegression is expecting 77 features as input on every sensor tick. Passing the polars DataFrame keeps column names intact so the SFD's pl.DataFrame branch (x = _frame_to_numpy(frame, self.model_cols)) selects the trained 77 columns by name and ignores extras, which is the contract _model_columns was designed for. The Sensor.predict callers downstream of produce_signal already accept polars DataFrames at training time (the Limen reference architectures' evaluate(...) paths feed data['x_test'] as pl.DataFrame from prepare_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 a polars.DataFrame with the actual training-feature column names intact, not a numpy.ndarray and not a polars reconstruction with default column_<i> labels. Captures type(data['x_test']) and the full column list inside a wrapper around wired.sensor.predict and asserts (1) the type is pl.DataFrame, (2) at least one column is present, (3) no column name starts with column_ (polars' default for unnamed columns — a regression like pl.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 matches manifest.with_params_override(split_config=(1,0,0)).prepare_data(market_data, round_params)['x_train'].columns exactly (pins that the captured frame is the actual one passed through, not a reconstructed one). Defends the fix against future re-introduction of to_numpy() or any other column-name-stripping transform in the predict path

v0.45.0 on 10th of May, 2026

Update

  • Bump vaquum_limen git+https pin from v3.0.5 to v3.0.6 (Vaquum/Limen#507). Limen v3.0.6 adds end_date_limit and row_count_limit (canonical name; legacy n_rows retained as alias) parameters to HistoricalData.get_spot_klines and HistoricalData.get_any_file. With both start_date_limit and end_date_limit set the data window is fully closed and reproducible across daily HF dataset snapshot growth — unblocks Praxis paper-trade deploys where Trainer.train()'s Pass 1 strict reconstruction check refits with whatever latest.json resolves to at run time, and pre-3.0.6 the daily HF snapshot drift made bars_total/backtest_* metrics deviate from the stored results.csv (manifest had only start_date_limit, so the window grew with the dataset), tripping ReconstructionError at sensor-wiring time. Nexus production code only imports from limen.experiment.trainer.trainer import Trainer (nexus/startup/sequencer.py:15); the public Trainer.__init__(experiment_dir, data=None) + Trainer.train(permutation_ids: list[int]) signatures are unchanged in v3.0.6 (verified by tests/test_limen_trainer_contract.py — all 10 contract tests pass against v3.0.6 unmodified). The end_date_limit / row_count_limit parameters land on the HistoricalData data-source method, not on Trainer directly, so SFDs adopt them by setting set_data_source(method=HistoricalData.get_spot_klines, params={..., 'end_date_limit': '<date>'}) in their manifest()
  • Update vaquum_limen 3.0.5 → vaquum_limen 3.0.6 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v3.0.6 Trainer class so the re-validate-on-upgrade contract is satisfied

v0.46.0 on 10th of May, 2026

Fix

  • Fix produce_signal to support RuleBasedManifest SFDs alongside MLManifest. Previously the predict path was hard-coded against the MLManifest.prepare_data output shape — data_dict.get('x_train') for the live train frame and wired.sensor.predict({'x_test': ...}) for the predict call. RuleBasedManifest.prepare_data returns a different shape: {'train', 'val', 'test', '_alignment', 'strategy'} with no x_train / x_test keys (per limen/experiment/manifest_core.py's RuleBasedManifest.prepare_data → _finalize_rule_based_data → split_data_to_rule_based_prep_output), so every rule-based sensor tick raised ValueError: 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_signal branches on isinstance(wired.limen_manifest, RuleBasedManifest) and pulls train / passes test for that path. ML-SFDs are unaffected — they keep using x_train / x_test. Surfaced when the operator manifest YAML staged a RuleBasedManifest-backed stub-strategy bundle alongside the existing BtcLogRegEVSFD (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_manifest and the _make_wired_rule_based_sensor fixture that drives the foundational limen.sfd.foundational_sfd.rule_based SFD through Trainer.train([1]) to produce a WiredSensor whose limen_manifest is a real RuleBasedManifest. The test wraps wired.sensor.predict with a key-capturing shim, runs produce_signal, and asserts (1) the captured data dict 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's predict(data) which reads data['test']. Pinning both halves keeps the manifest-type branching honest

v0.47.0 on 13th of May, 2026

  • Fix configure_logging to add structlog.stdlib.ExtraAdder() to ProcessorFormatter.foreign_pre_chain so 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 to nexus/infrastructure/observability.py wrapping structlog.contextvars.bound_contextvars
  • Wrap submit_actions per-iteration body in with 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_exception in tests/test_observability.py; add TestPerActionBoundContext (4 cases) in tests/test_action_submit.py

v0.48.0 on 17th of May, 2026

  • Add INFO-level signal produced log in nexus/strategy/predict_loop.py immediately after every produce_signal() call in tick_once and _tick, BEFORE the strategy runner dispatches the signal. Captures strategy_id, sensor_id, predictor_fn_id, and values so 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_log helper that coerces every entry to a JSON-safe form for the configured orjson renderer (no default= callback, no OPT_SERIALIZE_NUMPY flag) 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_dispatch asserts the log record carries the expected extras AND was emitted before dispatch_signal ran (ordering pinned via dispatch_signal side-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, and test_values_for_log_output_is_orjson_serializable cover every coerced type and round-trip the helper's output through orjson.dumps

v0.49.0 on 21st of May, 2026

  • Add _inject_reference_price shim in nexus/strategy/signal_producer.py that, after predict() returns, forwards the latest raw close from the pre-feature-engineering market_data frame into the Signal.values dict when the predictor didn't include close itself. ML pipelines that run close through fractional_diff (or any other column-replacing transform in prepare_data) cannot recover the raw price from inside predict(); rule-based / stub predictors that forward close directly are unaffected (existing values are never overwritten). Closes the silent-no-op failure mode where strategies keying on signal.get('close') for ENTER notional sizing produced zero commands despite firing _preds=1 predictions every tick
  • Add TestInjectReferencePrice test class in tests/test_signal_producer.py with 10 cases: close injected when absent, predictor-supplied close preserved verbatim, empty market_data is a silent no-op, missing close column is a silent no-op, non-numeric close value is a silent no-op, NaN close rejected at the boundary, +Infinity rejected, -Infinity rejected, Python bool close rejected, numpy.bool_ close rejected
  • Reject non-finite close (NaN / +/-Infinity) at the injection boundary in _inject_reference_price; float(polars_nan) returns math.nan without raising, so without the math.isfinite() guard the non-finite value would reach Signal.__post_init__ (nexus/strategy/signal.py:45-46) which raises ValueError: values['close'] must be finite and 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 bool and numpy.bool_ close values before the float cast in _inject_reference_price; float(True) == 1.0 / float(False) == 0.0 are both finite and would slip past math.isfinite, injecting a bogus 0/1 reference price. Matches the canonical Nexus bool-exclusion pattern (isinstance(val, bool) — see health_evaluator.py:42, :52, :105, :111). Polars scalar access can return either Python bool or np.bool_ depending on dtype, so both are checked explicitly (np.bool_ is not a bool subclass)

v0.50.0 on 23rd of May, 2026

Update

  • Bump vaquum_limen git+https pin from v3.0.6 to v3.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 declaring metadata.json["sfd_module"] = "yaml:<name>" with a manifest.yml instead of a <sfd_module>.py predictor file. The Limen Trainer API 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 / _manifest attribute reads in nexus/startup/sequencer.py (lines 634, 650-651 — flagged by # NOTE comments) all still exist; RuleBasedManifest is still re-exported from limen.experiment (limen/experiment/__init__.py) and still extends the same Manifest base with with_params_override(...) / prepare_data(...) shape consumed by produce_signal. 1385 Nexus tests pass and 17 are skipped against Limen v3.9.0 unmodified — including the 10 test_limen_trainer_contract.py cases that pin the Trainer public contract and the rule-based / ML-manifest branch tests in test_signal_producer.py; the one PytestUnhandledThreadExceptionWarning in test_outcome_processor.py::TestFinalMajor08RealizedPnlIsNetOfFees::test_winning_exit_realized_pnl_is_net_of_fees (worker thread FileNotFoundError on 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.0 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v3.9.0 Trainer class 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.18 via Limen v3.9.0 (limen/yaml/parser.py:4 imports from ruamel.yaml import YAML). Picked up automatically through Limen's pyproject.toml dependency list — Nexus does not import ruamel.yaml directly, but loading any yaml:-prefixed SFD bundle triggers the import chain through limen.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 via binancial and Praxis's dev extras — no Nexus runtime addition beyond ruamel.yaml

v0.51.0 on 24th of May, 2026

Update

  • Bump vaquum_limen git+https pin from v3.9.0 to v4.0.1 (Vaquum/Limen@v4.0.1). v0.50.0 pinned v3.9.0, but that tag's Trainer cannot reconstruct a YAML-based SFD bundle: Trainer.__init__ passes metadata.json["sfd_module"] (which for a YAML SFD is the CompiledSFD.__name__ literal "yaml:<name>") straight to _load_sfd_module, where the seg.isidentifier() path-traversal guard rejects the : and raises ValueError: sfd_module name 'yaml:...' is not a dotted sequence of valid Python identifiers. The YAML-reconstruction branch — Trainer.__init__ detecting metadata.json["yaml_reference"] and rebuilding the SFD via CompiledSFD(yaml_reference) instead of _load_sfd_module — only landed in Limen v3.9.2 (commits 7775f9a / 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 identifier ValueError under v3.9.0 and loads cleanly under v4.0.1 (Trainer init OK, MLManifest reconstructed, round 24 with 34 populated params)
  • Go to v4.0.1 (latest) rather than the minimal v3.9.2 fix. The only breaking change in the v3.9.2 → v4.0.1 span is UniversalExperimentLoop.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 through Trainer. The consumption API surface Nexus depends on is signature-identical across v3.9.2 → v4.0.1 (git diff on trainer.py / historical_data.py / manifest_core.py / experiment/__init__.py shows no signature changes to Trainer.__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 schema VERSION is 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 10 test_limen_trainer_contract.py cases that pin the Trainer public contract; the lone PytestUnhandledThreadExceptionWarning in test_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.1 in two nexus/startup/sequencer.py comments (lines 631, 651) flagging the private-attribute reads (cached_trainer._data, trainer._manifest); both private attributes still exist on the Limen v4.0.1 Trainer class 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.py housing the disk-cache and process-pool helpers for sensor reconstruction: bundle_id_for (SHA-256 over a bundle's metadata.json + manifest.yml, first 16 hex chars — auto-invalidates when limen_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.replace so a reader never sees a partial pickle), default_max_workers (NEXUS_WIRE_MAX_WORKERS, default 1 = serial/inline; set N > 1 to opt into N-process parallelism), and the ProcessPoolExecutor worker surface (init_worker loading each dir's frozen _data into a worker-global dict once per worker, reconstruct_sensor building Trainer(dir, data=…).train([perm]) and returning sensors[0] or None when train() yields no Sensor)
  • Add process-parallel reconstruction to _wire_sensors: the manifest is flattened into one _SensorWiringTask per (strategy, experiment_dir, permutation_id); one loader Trainer(dir) is constructed per unique resolved dir in the parent to obtain its _manifest (reused for every WiredSensor from that dir — never crosses the process boundary) and frozen _data; cache misses fan out across ProcessPoolExecutor seeded via the pool initializer (the ~160MB _data is passed once per worker, never per task), with only the ~16KB picklable Sensor crossing back. GIL-bound train() 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_DIR is set; unset preserves current behavior): on boot a cache HIT unpickles the stored Sensor and 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 loader Trainer(dir) per unique dir for the WiredSensor.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 via NEXUS_WIRE_MAX_WORKERS=N: misses reconstruct in the current process with no ProcessPoolExecutor, so a Trainer patched 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_misses before 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 single Sensor to every referencing task, producing one WiredSensor per 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-process Trainer: HIT skips reconstruction, MISS reconstructs and writes the pkl, corrupt cache falls back without crashing, distinct metadata.json yields distinct bundle_id, cache OFF never touches disk, and manifest.yml participates in the bundle_id

Update

  • Update tests/test_wire_sensors_data_cache.py to assert the new fetch-once invariant (exactly one loader Trainer(dir) per unique experiment_dir without data=, then one data=-bearing reconstruction per sensor) instead of the old chained-cache pattern (first ctor without data=, subsequent with data=cached._data); both encode the same PT-FIX-9 intent — the bundle data is fetched exactly once per unique experiment_dir and every sensor reconstructs from that one frozen slice — and the tests set _sensor_wire_max_workers = 1 so the patched Trainer applies in-process
  • Update tests/test_wire_sensors_isolation.py and tests/test_wire_sensors.py and tests/test_startup_sequencer.py to force the inline path (_sensor_wire_max_workers = 1) so their existing Trainer-mock assertions run in-process; the PT-FIX-18 isolation guarantee (per-sensor failure logged with full context and skipped; all-failed → StartupError with 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_sensors in nexus/startup/sequencer.py no longer runs a ProcessPoolExecutor; it reconstructs cache misses inline only. NEXUS_WIRE_MAX_WORKERS no longer affects the launcher — it now governs the standalone warmer below. Parallel reconstruction must be done ahead of launch via python -m nexus.startup.warm_cache. A deployment that previously set NEXUS_WIRE_MAX_WORKERS > 1 to 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-dir mirrors the launcher's MANIFESTS_DIR enumeration of every *.yaml/*.yml, plus repeatable --manifest), skips already-cached entries, and reconstructs the rest across a spawn ProcessPoolExecutor (NEXUS_WIRE_MAX_WORKERS / --max-workers). It pins OMP_NUM_THREADS/OPENBLAS_NUM_THREADS/MKL_NUM_THREADS/NUMEXPR_NUM_THREADS to 1 before spawning workers so N workers use N cores rather than N × cores (the BLAS oversubscription that made a 32-worker wire thrash all 48 cores at ~38 perms/min). Per-sensor ReconstructionError (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 a spawn context, 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 worker ProcessPoolExecutor in 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.so segfaults on a polars-N thread 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: Path field to WiredSensor (and pass task.resolved_dir at construction) so a predict worker can rebuild the (unpicklable) Limen manifest from disk via Trainer(experiment_dir)._manifest rather than receive it across the pickle boundary. The fitted sensor (small) still rides the submit pickle; the manifest is cached per worker in a module-level _WORKER_MANIFESTS dict 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=4 frames). 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: frozen PredictTask dataclass, _predict_worker_init, _predict_in_process(task, market_data_path) (rebuild manifest, read IPC, run produce_signal, return Signal), and _market_data_signature for the IPC cache key
  • Add NEXUS_PREDICT_MAX_WORKERS (default 16) and NEXUS_PREDICT_POLARS_MAX_THREADS (default 1); the latter is set via os.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 (N workers x M rayon threads) without changing parent-side Polars use

Fix

  • Replace PredictLoop's bounded ThreadPoolExecutor with a spawn ProcessPoolExecutor, lifting the GIL-bound prepare_data cost out of the predict cycle. On a 5000-permutation 15m deploy, threads do not scale (Limen MLManifest.prepare_data is ~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's from nexus.strategy.predict_loop import PredictLoop under TYPE_CHECKING. The import was annotation-only (the file already has from __future__ import annotations), but the existing chain predict_loop -> nexus.startup -> shutdown_sequencer -> predict_loop blocked a spawn worker from importing predict_loop as a fresh entry point (the worker must, to unpickle _predict_in_process); the old in-process ThreadPoolExecutor path never re-imported the module from a clean interpreter and so never hit the cycle
  • Rework tests/test_predict_loop.py to drive the parent scheduler via an in-process _SyncExecutor test double plus a stubbed _predict_in_process (autouse fixture scoped to TestPredictLoop). The original MagicMock sensor/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 patching Trainer and writing a real IPC frame
  • Drop the two _tick_worker/tick_once drift-sentinel tests in tests/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_once is unchanged (still in-process synchronous), and the runtime parity test for tick_once alone is retained
  • Update remaining WiredSensor(...) construction sites in tests/test_predict_loop.py, tests/test_predict_loop_tick_once.py, and tests/test_signal_producer.py to pass the new required experiment_dir field

v0.53.1 on 29th of May, 2026

Add

  • Add tests/test_signal_pickle.py: direct pickle.dumps/loads round-trip plus a real multiprocessing.get_context('spawn') ProcessPoolExecutor round-trip that returns a Signal from a worker through the pool's _sendback_result to the parent's future.result(). This is the exact production failure path; the test fails if Signal.__reduce__ is removed or stops unwrapping values to a plain dict
  • Add TestSerializeStateConcurrentMutation to tests/test_wal_codec.py: three threading-barrier tests covering state.positions, state.strategy_modes, and state.risk.per_strategy, plus a round-trip test for state.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 a threading.Event during 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's is_alive() so a missed synchronisation fails deterministically instead of silently passing. Without the snapshot in the corresponding encoder, the next item-view step raises RuntimeError: dictionary changed size during iteration and 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 calls str(deployed) directly), so it is covered by a round-trip test that exercises the encode + decode with populated per_strategy_deployed; the snapshot mechanism itself is proven by the analogous barrier tests

Fix

  • Add Signal.__reduce__ in nexus/strategy/signal.py so a Signal returned from a spawn ProcessPoolExecutor worker survives the pool's result-pickle path. Signal.__post_init__ wraps values in types.MappingProxyType for immutability, which is not picklable by default. The v0.53.0 ThreadPoolExecutor → spawn ProcessPoolExecutor swap in PredictLoop now pickles every worker return value via the pool's _sendback_result, and the first predict cycle of the v0.53.0 deploy raised TypeError: cannot pickle 'mappingproxy' object inside the worker and re-raised at future.result() in the parent (the prior in-process ThreadPoolExecutor never crossed a process boundary, so the gap was latent). __reduce__ re-emits the constructor args with values unwrapped to a plain dict; unpickle re-runs __post_init__ and re-wraps it on the receiving side, so consumers still see a MappingProxyType and a plain mappingproxy never goes on the wire. Validated as the praxis:0.68.0-mp1 monkeypatch image on prod (run 14:17–15:58 UTC: 16,241 signal produced, 4,253 command submitted, 0 pickling errors, 0 restarts)
  • Snapshot every mutable dict iterated inside serialize_state via dict() before the per-item encode comprehensions, covering all four sites: state.positions and state.strategy_modes at the top level, plus state.capital.per_strategy_deployed inside _encode_capital_state and state.risk.per_strategy inside _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 raised RuntimeError: dictionary changed size during iteration when an OutcomeProcessor / dispatch thread mutated state.positions while state_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 to REDUCE_ONLY — blocking every subsequent ENTER until the next epoch reset. wal_lock is innermost in the lock chain (command_registry_lock -> positions_lock -> CapitalController._lock -> wal_lock), so the per-strategy dicts inside capital and risk are 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_pnl was set on entry (typically zero) and never re-touched until close, so RiskState.unrealized_pnl and 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 into state_store.checkpoint(state) patterned on HealthLoop (daemon threading.Timer, start/stop/tick_once, idempotent, lock-safe). Holds the positions_lock + CapitalController._lock around the checkpoint call so the snapshot captures a consistent point-in-time view, then state_store.checkpoint() acquires wal_lock internally (same lock pattern as shutdown_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 of state.positions. Three-phase tick to avoid holding positions_lock (== state.risk.lock, non-reentrant) across the mark_price_provider call: 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_sign from the CURRENT Position.size/entry_price (so partial-fill mutations between phases are respected), writes Position.unrealized_pnl, buckets per-strategy into StrategyRiskState.strategy_unrealized_pnl (creating StrategyRiskState lazily for strategies that opened a position but haven't exited yet), and finally writes the instance aggregate via RiskState.update_unrealized_pnl which calls recompute_drawdown_metrics so equity, equity_hwm, total_drawdown, unrealized_drawdown stay coherent. If the provider returns None or 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 current RiskCheckMetrics surface consumed by risk_stage exposes instance-level fields only, so the per-strategy strategy_unrealized_pnl field 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 = _ZERO field to StrategyRiskState with __post_init__ finite-check (signed; can be negative). _encode_strategy_risk_state emits the new key; _decode_strategy_risk_state defaults 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 inside positions_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_pnl triggering recompute_drawdown_metrics, multi-symbol provider-called-once-per-symbol invariant, positions_lock held during provider calls, per-strategy attribution (each StrategyRiskState.strategy_unrealized_pnl reflects only its own positions), lazy StrategyRiskState creation 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_lock enforced at construction)
  • Add max_total_drawdown: Decimal = _ZERO and max_total_drawdown_pct: Decimal = _ZERO fields to RiskState; recompute_drawdown_metrics now ratchets max_drawdown / max_drawdown_pct from realized-only drawdown and ratchets the new max_total_drawdown / max_total_drawdown_pct from total (realized + unrealized) drawdown. Pre-v0.54.0 unrealized_pnl stayed at zero across the runtime (no MTM loop), so total_drawdown == realized_drawdown always and the historical max_drawdown values 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's to_risk_check_metrics reads max_drawdown_pct, so a calibrated gate threshold stays valid; the new max_total_drawdown_pct is exposed for telemetry and for any future gate that wants strictly tighter mark-aware discipline). _encode_risk_state emits both new keys; _decode_risk_state defaults missing values to '0' so older Nexus snapshots decode without error and the next MtmLoop tick bumps the new field to current total_drawdown if needed

Fix

  • Enforce the lock-cluster invariant at SnapshotScheduler and MtmLoop construction, mirroring ShutdownSequencer's pattern at shutdown_sequencer.py:188-216. Whenever positions_lock is supplied, state.risk.lock must be the same object — both loops mutate / read state.risk.per_strategy and write RiskState fields whose mutual exclusion against OutcomeProcessor and the validator depends on lock identity. SnapshotScheduler additionally requires capital_lock_cm whenever positions_lock is supplied; the two form a lock-cluster and partial wiring leaves the capital-side dictionary changed size during iteration race against OutcomeProcessor reachable. A mis-wired launcher now fails loudly at construction with the same message shape as ShutdownSequencer rather than producing unguarded per_strategy iteration during a live tick (PR #77 review by zero-bang)
  • Update tests/test_risk_state.py: test_recompute_drawdown_metrics_tracks_losses_without_new_peak and test_recompute_drawdown_metrics_preserves_lifetime_max_drawdown are rewritten to pin the post-v0.54.0 split semantics — max_drawdown no longer ratchets from a transient unrealized loss; max_total_drawdown carries 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: SnapshotScheduler periodic checkpoint inherits the TD-073 latency-spike class, now recurring every 5 min during live trading rather than only at shutdown. state_store.checkpoint() holds positions_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: split save_snapshot(state, path, wal) into serialize(state) -> bytes (under lock) + persist(payload, path, wal) (lock-free, fsync-bound). Restructuring state_store internals 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_fill for the entry-fill notional residual). Change 2 (the 4–5 _compute_exit_cost_basis return None exit-side leak paths in outcome_processor.py: avg_cost_basis == 0, fill_size > position.size, position is None, cross-strategy strategy_id mismatch, and trade_id is None) stays open against #78 as a separate follow-up PR; it needs force-release semantics for the recoverable cases and LifecycleResult failure 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-zero state.capital.per_strategy_deployed[strategy_id] while having ZERO open positions in state.positions. Total ghost-deployed sum ≈ $2,058 across the fleet, averaging $2-7 per closed strategy. The aggregate invariant sum(per_strategy_deployed) == position_notional + working_order_notional continued to hold, so the residuals were real capital "parked" against flat strategies, not a bookkeeping divergence. Pre-fix, CapitalController.order_fill only removed a TrackedOrder and released its residual when new_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 positive remaining_notional parked in working_order_notional and per_strategy_deployed forever. OutcomeProcessor._handle_fill never 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: bool keyword-only required parameter to CapitalController.order_fill (no default — every caller must make an explicit choice; the Greybeard rationale + caller-migration is in the ### Update block below). When terminal=True AND new_remaining > _ZERO, the controller releases the residual TrackedOrder.remaining_total (remaining_notional + prorated estimated fees) from working_order_notional and per_strategy_deployed after the existing fee-delta reconciliation, then pops the order from _orders. The two pop branches (new_remaining == _ZERO and terminal) are combined into a single condition since both transition the order to its terminal state. The production caller in OutcomeProcessor._handle_fill passes terminal=outcome.outcome_type == TradeOutcomeType.FILLED explicitly; non-terminal partial-fill behavior (order stays in _orders, residual stays tracked) is preserved when callers pass terminal=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=False call 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 at fill_notional + actual_fees with no fee-ghost)

Update

  • Thread the new terminal flag through OutcomeProcessor._handle_fill at the entry-fill order_fill call site. The flag is derived as outcome.outcome_type == TradeOutcomeType.FILLED — Praxis-side FILLED is the terminal status (no more fills coming for this command_id) while PARTIAL is non-terminal (more fills expected, residual must stay tracked). Other outcome types (REJECTED, CANCELED, ACK) reach different _handle_* paths and never call order_fill, so the change is localized to the entry-fill branch. The 56 existing outcome_processor tests pass unchanged
  • Pre-PR Greybeard review: make terminal keyword required (no default). The original draft had terminal: bool = False for 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 in tests/test_capital_controller.py) is updated to pass terminal=False explicitly. The production caller in OutcomeProcessor._handle_fill always passes the derived value
  • Pre-PR Greybeard review: defensive invariant guard inside the terminal-release branch — residual = updated.remaining_total is checked >= _ZERO before being subtracted from working_order_notional and per_strategy_deployed. A future TrackedOrder refactor that lets remaining_total drift negative would have silently inflated aggregates; the guard returns INVARIANT_BREACH instead
  • Pre-PR Greybeard review: add TestEntryFillTerminalThreading (2 cases) to tests/test_outcome_processor.py pinning the OutcomeProcessor → CapitalController contract end-to-end. test_fill_outcome_terminal_releases_residual proves outcome_type=FILLED zeros the residual on under-fill; test_partial_outcome_non_terminal_keeps_residual proves outcome_type=PARTIAL keeps the order in _orders for the next fill. A future refactor that drops the terminal= kwarg at the call site, or remaps outcome_type to 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_fill honors caller-supplied terminal flag without verifying fill_notional reached order.notional — defensive guard against future translator/adapter misclassification. TD-093: combined if new_remaining == _ZERO or terminal: pop branch obscures the two distinct pop reasons. TD-094: two _adjust_strategy_deployed calls 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 >= _ZERO invariant guard in CapitalController.order_fill before any state mutation. The original Greybeard guard ran after the order was popped, working_order_notional / position_notional / fee_reserve had been mutated, and _adjust_strategy_deployed had been called for fee_delta — if the guard ever fired, callers seeing INVARIANT_BREACH could retry and double-apply the already-committed mutations. The fix computes terminal_residual = updated.remaining_total upfront in the new_remaining > _ZERO branch (alongside fill_with_estimated and proportional_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 invariant fill_notional <= order.remaining_notional plus estimated_fees >= 0 keeps updated.remaining_total >= 0), but a future TrackedOrder refactor 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 new Action.quote_qty field threads through translate_to_trade_command and PraxisOutbound.send_command, but Praxis must accept quote_qty= on submit_command for 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_fill overfill rejection). Option C ([this PR + companion]) replaces the buffer with Binance's native quoteOrderQty parameter: 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 = None field to Action with __post_init__ validation: finite positive Decimal or None; mutually exclusive with size on ENTER (exactly one required); must be unset on EXIT; ENTER with quote_qty is restricted to direction == OrderSide.BUY and order_type == OrderType.MARKET so a malformed action is rejected at strategy boundary before any reservation is taken (Binance's quoteOrderQty REST parameter only accepts MARKET BUY)
  • Add quote_qty: Decimal | None = None field to TradeCommand with __post_init__ validation: finite positive Decimal or None; on NEW_ORDER requires exactly one of size or quote_qty; must be unset on AMEND_ORDER and CANCEL_ORDER. translate_to_trade_command threads action.quote_qty into the command; when set, TradeCommand.size is None and the venue determines the executed base from live liquidity. PraxisOutbound.send_command sends quote_qty=command.quote_qty to Praxis's submit_command; the Praxis side decides whether to map it to Binance's quoteOrderQty parameter or reject

Update

  • Switch logreg_binary_evsfd ENTER from size = notional / reference_price to quote_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_price is still forwarded for slippage observation by Praxis but is no longer load-bearing for the order shape
  • Relax ENTER intake at make_reference_integrity_hook to accept order_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-in INTAKE_ORDER_NOTIONAL_ZERO check at validate_intake_stage line 404 rejects ENTER with order_notional <= 0; the ref-hook then rejects explicit non-positive order_size (size set but <= 0) with INTAKE_ENTER_SIZE_INVALID. Quote-native ENTER (order_size is None, order_notional > 0) falls through to allowed
  • Make OrderContext.order_size Decimal | None; required for EXIT (the controller's _clear_pending_exit path reads it for cancellation/reject release), optional for ENTER (the entry path uses outcome.fill_size from the venue rather than the pre-submit reservation). __post_init__ checks is_entry type 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, TradeCommand NEW_ORDER XOR (size/quote_qty), intake_stage relaxation (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_QTY rejection at the Praxis launcher every 15–30 min. Root cause: full-position EXIT actions emit Action.size = position.size - position.pending_exit in full Decimal precision (e.g. 0.01000842 BTC); the Praxis launcher's quantize_for_command snaps to LOT_SIZE.stepSize (e.g. 0.01000000) before submitting; the post-fill _reduce_position in this codebase decremented position.size by the snapped qty, leaving 0.00000842 BTC residue; Position.is_closed is exact-zero so the residue kept the trade alive in state.positions; the next tick's full-position EXIT computed the residue as its size; the launcher's quantize_for_command rejected the sub-lot qty as below lot_min; _build_exit_context returned None and 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 both ValidationRequestContext and OrderContext because praxis/launcher.py:_build_order_context re-runs build_context rather than passing the original through, so a field only on OrderContext would be lost across the rebuild.

Add

  • Add intended_full_close: bool = False to ValidationRequestContext. __post_init__ validates it's a bool. Set by the Praxis launcher's _build_exit_context when Action.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. Default False preserves all existing callers.
  • Add intended_full_close: bool = False to OrderContext. Carried across the _build_order_context rebuild on the Praxis launcher (praxis/launcher.py:913) by explicit field-copy. __post_init__ validates it's a bool AND rejects intended_full_close=True together with is_entry=True — the flag only makes sense on EXIT orders. Default False preserves all existing callers.
  • Add account_dust: dict[str, Decimal] = field(default_factory=dict) to InstanceState. 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-negative Decimal.
  • 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, moves position.size into state.account_dust[symbol], removes the position from state.positions. Idempotent on dust_close_id via a new _processed_dust_close_ids: set[str] (separate from _processed_outcome_ids so the dust-close dedup is independent). Returns False on dedup hit or missing position; True on successful close. Does NOT emit TradeClosed / TradeOutcomeProduced — no venue order ever existed and those events are owned by Praxis's ExecutionManager after a real fill.
  • Add 14 new tests across tests/test_outcome_processor.py (7 cases under TestDustClose covering 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), and tests/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 existing position.size = position.size - fill_size decrement, if outcome.outcome_type == TradeOutcomeType.FILLED AND context.intended_full_close AND position.size > _ZERO, move the residue into state.account_dust[position.symbol], zero position.size, then fall through to the existing if position.is_closed: del state.positions[trade_id] branch. Partial-exit and non-terminal-fill paths are unchanged.
  • Update wal_codec.serialize_state to encode account_dust as {symbol: str(Decimal)} alongside the existing fields. _decode_state_v1 reads account_dust via d.get('account_dust', {}) so snapshots written before this release (no account_dust key) 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 call OutcomeProcessor.close_as_dust in the rejection branch ship there. Nexus alone is dormant until that companion lands (the new field defaults to False so 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_ack transitions a TrackedOrder from IN_FLIGHT to WORKING, but TrackedOrders are only created by send_order from 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 historical OutcomeLoop queue lag simply meant EXIT ACKs were rarely processed promptly enough for the failure to surface in volume.

Update

  • Update OutcomeProcessor._handle_ack to accept the OrderContext and return a no-op success for is_entry=False outcomes — the venue acknowledged the sell and there is no capital lifecycle to transition. ENTER ACKs are unchanged: they still call CapitalController.order_ack and transition IN_FLIGHT to WORKING. The no-op success also restores the normal OutcomeAcked spine 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 with capital_updated=False; EXIT ACK leaves in_flight_order_notional and working_order_notional untouched 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_contexts only after send_command returns for the whole batch — so the translated ACK and FILLED outcomes reached the OutcomeLoop ~1ms before registration became visible. The synchronous accounting path skips on missing OrderContext (by design, deferring to the async path), and the OutcomeLoop dropped the outcomes terminally on the resolve_strategy_id miss. 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_once and the new _try_dispatch / _park / _service_unresolved_retries internals so an unresolved strategy_id is retried instead of dropped: the outcome opens a per-command FIFO retry queue scheduled on the new module constant UNRESOLVED_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 fail CapitalController.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 with command_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_command transmits the Nexus command.command_id to the injected submit function when that function accepts it (detected once at construction via inspect.signature, exposed as the public supports_command_id property), 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 explicit command_id parameter (authoritative — a divergent returned id raises CommandIdMismatchError so the caller rolls back rather than holding a registration keyed on an id the venue command does not carry) from a **kwargs catch-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, the SubmissionRegistration protocol (mark_submitted / mark_unknown / rollback), and an optional pre_register callback to submit_actions. When the launcher supplies a pre_register (only when supports_command_id is true), the command's lifecycle is bridged before the send_command handoff, and a handoff timeout becomes SUBMISSION_UNKNOWN — reservation and registration retained for reconciliation by the deterministic id — instead of SUBMIT_FAILED releasing capital for a command that may still execute. A non-timeout failure calls handle.rollback; a pre_register failure 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 StateSnapshotLocks and an optional snapshot_locks parameter to StateStore: when supplied, append_mutation and checkpoint acquire positions_lock then capital_lock (the documented chain order) around the serialize_state call, so a snapshot can no longer interleave state.positions / state.account_dust / capital reads with a concurrent mutation on another thread (the OutcomeLoop worker, the Praxis synchronous-accounting path, or the submitter's pending_exit writes) — 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_event does not take the locks (it serializes a StrategyEvent, not InstanceState); construction without the bundle preserves the prior unguarded contract (#88)

  • Add 4 tests to tests/test_state_store.py: append_mutation and checkpoint acquire the locks in chain order; append_event takes neither; legacy construction without locks is unchanged

Fix

  • Fix the timing-flaky test_broken_pool_submit_does_not_kill_scheduler in tests/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 StateSnapshotLocks bundle but left it unwired, because enabling it conflicts with the two sites that already wrap StateStore.checkpoint() in the same locks: once the store acquires positions_lock + capital_lock internally, an external wrap re-acquires non-reentrant locks and self-deadlocks. This release moves snapshot-serialization locking fully into StateStore and deletes both external checkpoint wraps. _final_checkpoint and SnapshotScheduler._checkpoint now call checkpoint() bare; the store owns the locking when the launcher builds it with the bundle. The state.risk.lock is positions_lock identity that the wraps used to enforce (so positions_lock also covered state.risk.per_strategy serialization) now belongs at the launcher composition point where the bundle is built — not in these loops, which no longer serialize state. ShutdownSequencer keeps positions_lock only for its direct state.positions access (_dispatch_shutdown, _submit_exit), which the bundle does not cover (#92)

Update

  • Update ShutdownSequencer._final_checkpoint to call state_store.checkpoint() directly with no positions_lock / capital_lock wrap — StateStore owns the snapshot locks via its StateSnapshotLocks bundle and acquires them in the same chain order inside checkpoint(), 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_deployed serialization cannot race a live OutcomeLoop worker) is preserved by the bundle plus the launcher's state.risk.lock is positions_lock wiring
  • Remove the capital_controller parameter from ShutdownSequencer: it was used only by the deleted _final_checkpoint wrap. The state.risk.lock is positions_lock and capital_controller-required construction guards are removed with it — the identity is now enforced at the launcher where the bundle is built. positions_lock stays for the direct state.positions iteration sites
  • Remove the positions_lock and capital_lock_cm parameters from SnapshotScheduler and its construction guards: _checkpoint now calls state_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 real StateStore built with the StateSnapshotLocks bundle completes _final_checkpoint without deadlocking (the store acquires the locks the method no longer wraps); _final_checkpoint holds no external positions_lock during the store call; and the sequencer accepts positions_lock without enforcing the state.risk.lock identity

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 StateSnapshotLocks bundle at StateStore construction: the store must exist first so StartupSequencer can recover InstanceState, and only after recovery do the positions_lock / capital_lock and the recovered state exist. The recovery-then-runtime split is a legitimate StateStore lifecycle, 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 the StateSnapshotLocks bundle after construction, so append_mutation / checkpoint acquire it around serialize_state exactly as if it had been passed to __init__. Behaviorally identical to construction-time injection because _state_read_guard reads the bundle per call; the caller attaches after recovery and before any concurrent mutator starts. Raises RuntimeError on a second attach (a re-attach would silently swap the locks live mutators rely on) and TypeError on a non-StateSnapshotLocks argument (a None would leave serialization silently unguarded)
  • Add 4 tests to tests/test_state_store.py::TestStateSnapshotLocks: a late attach_snapshot_locks engages the lock guard on the next append_mutation / checkpoint (and not before); a second attach raises RuntimeError; a non-bundle argument raises TypeError; a second attach with a non-bundle argument still raises RuntimeError (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 single signal: {series, interval_seconds, stale_policy, name?} binding to a Conduit prediction series; SensorSpec is replaced by SignalSpec and StrategySpec.sensors by StrategySpec.signal. WiredSensor is replaced by SignalBinding and StartupSequencer.wired_sensors by StartupSequencer.signal_bindings. PredictLoop drops the market_data_provider / wired_sensors constructor parameters in favour of signal_bindings plus conduit_dir / arrow_dir. Downstream launchers must update the manifest schema and the PredictLoop wiring and mount the furnace_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-drift ReconstructionError that 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 only polars

Add

  • Add SignalSpec (series, interval_seconds, stale_policy='skip', name) and SignalBinding (strategy_id, series, interval_seconds, name); StartupSequencer builds one SignalBinding per strategy directly from the manifest with no filesystem, Trainer, or sensor cache
  • Rewrite PredictLoop as a single-process Conduit poller: one daemon thread polls each binding on interval_seconds, re-reads serving_manifest.json (skips the tick when generated_at is older than 120s or the series is absent), takes the greatest-ts reason_code == 0 row from /opt/conduit/<series>/latest.arrow, dedupes by (strategy_id, series, ts), logs the active cohort and emits a distinct change event when cohort_id changes (never gating), joins the matching close from /opt/arrow/<series>/latest.arrow (skips when absent), and dispatches Signal{_preds, _probs, close}; a failed tick is logged and the thread continues

Remove

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_position already nets exit fees at outcome_processor.py via realized_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_capital previously 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 (raises StartupError) so the divergence is investigated rather than resolved by data loss. Pairs with the Praxis fix that stops entry fills from emitting TradeClosed (which made Praxis under-report open positions on replay)
  • Match Praxis positions on pos.trade_id rather 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_residue and test_decode_capital_state_rejects_meaningful_negative to tests/test_wal_codec.py
  • Add TD-096 recording the structural follow-up (collapse the two-step terminal residual release in order_fill into one exact decrement)

Fix

  • Snap sub-ULP Decimal residues in CapitalController capital aggregates to zero so a restart cannot brick on recovery. After a fee-bearing terminal fill, the reserve/release arithmetic (proportional-fee division in TrackedOrder.remaining_total) could leave working_order_notional at a sub-ULP negative (e.g. -1E-27); CapitalState.__post_init__ rejects any negative, so deserialize_state failed and the instance crash-looped on boot. order_fill now snaps working_order_notional, fee_reserve, and per_strategy_deployed residues within _SUB_ULP_TOLERANCE to zero (the fee_reserve snap previously handled only tiny negatives; _adjust_strategy_deployed now treats sub-tolerance magnitudes as zero rather than logging a false underflow). Latent until the Praxis fee fix made actual_fees non-zero
  • Add a narrow recovery shim in wal_codec._decode_capital_state: snap sub-tolerance negative persisted aggregates to zero before constructing CapitalState, so snapshots already carrying a residue boot. The CapitalState non-negative invariant stays strict — only sub-_SUB_ULP_TOLERANCE negatives are snapped; meaningful negatives still raise

v0.66.0 on 19th of June, 2026

Add

  • Add TestProcessedDedupIds to tests/test_wal_codec.py: the durable processed_outcome_ids / processed_dust_close_ids sets survive a serialize → deserialize round-trip, default to empty, and a pre-Nexus#86 payload missing the keys decodes to empty sets
  • Add TestOutcomeProcessorDurableDedup to tests/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). OutcomeProcessor previously held the processed outcome_ids in a process-local set, lost on restart; combined with the mutation being persisted by the launcher's append_mutation, a replay of an un-acked-but-already-applied outcome (process killed between append_mutation and the Praxis OutcomeAcked) re-entered _handle_fill and mutated capital and position a second time. The dedup sets now live on InstanceState (processed_outcome_ids, processed_dust_close_ids), so the successful id is persisted atomically with the mutation it guards and restored by StateStore.recover; the replay is recognised and returns a no-op success. The same durability now also covers close_as_dust. Serialized via the existing wal_codec v1 payload with .get back-compat, so pre-upgrade snapshots load unchanged
  • Perform the durable dedup-set writes under positions_lock (the lock domain serialize_state reads under, matching the account_dust precedent) instead of only _dedup_lock, so a concurrent SnapshotScheduler.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 clock to CapitalController: 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 TestInjectedClock to tests/test_capital_controller.py: a reservation's expires_at is computed from the injected clock, and both _purge_expired and send_order's expiry check honour it

v0.68.0 on 9th of July, 2026

Add

  • Add ModeController arbitrating operational mode against sticky manual and risk halt holds; it writes state.mode on the health-and-hold-arbitrated path. It is not yet the process-wide sole writer — StartupSequencer and ShutdownSequencer still set state.mode directly, and wiring the controller into the launcher (construction, reconcile before 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 / OperationalHolds on InstanceState.mode_holds, persisted through the WAL codec with backward-compatible decode
  • Add RiskBreakerThresholds and ModeController.evaluate_risk for daily-loss and drawdown circuit-breakers evaluated on the health tick. Breakers trip on a strict breach (observed > limit, matching risk_stage), read RiskState under state.risk.lock_cm() so the per-strategy sum and drawdown reads are consistent against concurrent OutcomeProcessor / MtmLoop writers, and reject non-positive thresholds (None disables a breaker)
  • Add ModeController.reconcile to re-derive the mode on restart before startup actions drain
  • Add an optional on_halt callback fired outside the lock when the mode transitions to HALTED
  • Route HealthLoop mode writes through an optional ModeController
  • Parse per-account risk_controls from the manifest into RiskBreakerThresholds

v0.69.0 on 10th of July, 2026

Fix

  • Guard the ModeController risk-breaker read against a self-deadlock when the RiskState lock is the controller's own lock. The launcher wires ModeController, positions_lock, and state.risk.lock to one shared threading.Lock, so reconcile / evaluate_risk / apply_health_and_risk — which since v0.68.0 acquired state.risk.lock_cm() inside the already-held mode lock — re-entered the same non-reentrant lock and hung the boot thread in reconcile before it reached the run loop, so shutdown never completed. _risk_reads_cm now returns a no-op context manager when state.risk.lock is 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 leave state.risk.lock unset (None → nullcontext); only the shared-lock launcher wiring triggers it. New test_shared_lock_wiring_does_not_deadlock drives reconcile / evaluate_risk / apply_health_and_risk under 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_mode so it survives a restart. ModeController now reads and writes state.health_mode (previously an in-memory _health_mode), and reconcile recommits from it directly rather than seeding only when the recovered state.mode.trigger was 'health'. Before this, a health-derived REDUCE_ONLY was lost across a restart whenever a hold masked it as HALTED (recovered trigger read 'manual'/'risk', so the seed never fired and the fresh controller defaulted _health_mode to ACTIVE); clearing the hold then resumed ACTIVE instead of REDUCE_ONLY. wal_codec encodes health_mode and decodes it with a backward-compatible ACTIVE default for pre-field snapshots
  • Add a dedicated shutdown_hold to OperationalHolds and ModeController.set_shutdown_halt / clear_shutdown_halt. _mode_source ranks it above manual and risk, so the shutdown HALT reports trigger='shutdown' and cannot be lifted by a concurrent health tick. wal_codec round-trips it with a backward-compatible inactive default. reconcile clears 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 ModeController the sole writer of state.mode on the live path. StartupSequencer._determine_mode now writes its boot decision into state.health_mode (the health input) instead of committing a ModeState with a boot_* trigger; the launcher's ModeController.reconcile, which runs after start, commits it. This also fixes a boot clobber: previously _determine_mode set REDUCE_ONLY (no-health-data safety) and then reconcile overwrote it with ACTIVE, because reconcile only seeded the health mode when the trigger was 'health' and the boot trigger was 'boot_no_health_data'. ShutdownSequencer._halt_state_mode now places the shutdown hold through an injected ModeController (falling back to a direct state.mode write 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.md with 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 Strategy quickstart, Risk Boundary, and the standard tail. Every claim is backed by code on main; 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 MODIFY action to Praxis. Action gains a modify_params mapping carrying mode-specific absolute new values (rejected when empty), and a MODIFY action now requires command_id, execution_mode (selecting the amend-parameter shape), and modify_params. PraxisOutbound.send_modify bridges a validated amend to an injected submit_modify_fn (Praxis Trading.submit_modify); the launcher wiring PraxisOutbound must supply submit_modify_fn for a strategy MODIFY to reach Praxis, and without it send_modify raises RuntimeError
  • Route a strategy MODIFY through the validator rather than bypassing it: submit_actions validates the amend and only then calls send_modify, so the intake operational-mode gate (HALTED blocks amends, unlike ABORT/CANCEL which only wind down) and the modifiable_command_ids lifecycle check apply. An amend re-parametrizes an already-sized command and never changes total notional, so MODIFY joins the exit actions in the capital/risk/health/price/platform bypass set — no new capital is reserved. A validated MODIFY carries no TradeCommand, so translate_to_trade_command now rejects MODIFY fail-fast instead of mapping it to a payload-less AMEND_ORDER
  • Add a modifiable_command_ids_provider form to make_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. FundTransaction and ReconciliationMismatch mirror the Praxis reconciliation events. OutcomeProcessor.process_fund_transaction records a detected deposit/withdrawal for Manager awareness — idempotent on fund_transaction_id — and never calls the CapitalController, so a deposit does not increase the tradeable capital pool (CapitalState.capital_pool is a write-once manifest ceiling with no runtime mutator). ReconciliationHandler applies the account's configured response to a mismatch
  • Add per-account reconciliation_mismatch_response to Manifest — HALT, REDUCE_ONLY, or ALERT_ONLY — defaulting to HALT (fail-safe: an unconfigured account halts on a balance divergence rather than trading through it)
  • Add a REDUCE_ONLY hold path to ModeController. A new ReduceOnlyHolds structure carries the reconciliation reduce-only hold, arbitrated in _recommit as HALT outranks REDUCE_ONLY outranks the health-derived mode; a reconciliation_hold is added to OperationalHolds for 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_HALT or REDUCE_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_response to Manifest, defaulting to FLATTEN_THEN_HALT (fail-safe: flatten the reconciled remaining position, then halt), sourced alongside reconciliation_mismatch_response so a mixed book configures each account independently

v0.74.0 on 16th of August, 2026

Add

  • Add a bracket-protection hold to ModeController. A new protection_hold on OperationalHolds and a protection reason on ReduceOnlyHolds are arbitrated in _recommit exactly like the reconciliation holds — HALT outranks REDUCE_ONLY outranks the health-derived mode — with set_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. ProtectionRemediation mirrors the Praxis signal that a bracket's protective OCO could not be restored and was remediated locally. ProtectionRemediationHandler applies the account's bracket_protection_failure_response: FLATTEN_THEN_HALT drives the durable HALT hold (Praxis has already flattened), REDUCE_ONLY forces 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_bps lets a strategy creator set a per-strategy deviation cap in bps in the manifest; InstanceConfig.price_deviation_max_bps_by_strategy and PriceStageLimits carry the per-strategy map, and validate_price_stage resolves the effective cap per strategy — a strategy's own cap overrides the account-level price_deviation_max_bps, which remains a backward-compatible fallback. The deviation reference is the strategy's own decision price, threaded through as ValidationRequestContext.reference_price; a configured strategy that emits no reference price is rejected PRICE_SYSTEM_DATA_UNAVAILABLE, and an ENTER whose deviation exceeds the cap is rejected PRICE_DEVIATION_LIMIT. The origo_mid book-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_bps and arrival_slippage_bps to the Praxis-connector TradeOutcome. 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 the PARTIAL that 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: a SELL filling 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_bps and arrival_slippage_bps on the Praxis-connector TradeOutcome. Both are displacements of the command's cumulative average fill price, not of the fill_price the carrying outcome reports, and the previous wording said only "the average fill price" — a reader pairing that with the delta fill_price beside 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-None value 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's fill_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.

Edit this sourceCheckout revision · 3832ded4
Reference / keep your place
Find a passage