refactor(core): establish clean deterministic Core package baseline#9
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactored
tradingchassis_coreinto a clean standalone deterministic Core package baseline.The Core package now centers on one explicit pipeline:
EventStreamEntry→
process_event_entry/process_canonical_event→ Strategy Evaluator
→ generated Intents
→ CandidateIntentRecords
→ dominance / reconciliation
→ Policy Admission
→ ExecutionControl plan/apply
→
CoreStepResult.dispatchable_intentsRuntime dispatch remains outside Core.
This change removes legacy compatibility paths, cleans the public API, hardens tests and typing, improves package metadata/docs, adds a Core-only quickstart, and updates
run_core_wakeup_stepto reduce all events first and evaluate Strategy once on the final wakeup state.Motivation
This change is necessary to make
tradingchassis_corea clear, standalone decision-engine package instead of a mixed transitional Core/Runtime/legacy compatibility layer.The goal is to provide a deterministic trading decision kernel that can be shared across backtest, simulation, research, and live Runtime environments. Runtime-specific concerns such as venue I/O, dispatch, Kubernetes/infrastructure, credentials, and adapter behavior stay outside Core.
The refactor reduces ambiguity, removes unused or legacy compatibility concepts, and strengthens Backtest/Live Parity by ensuring the same deterministic decision pipeline is used regardless of surrounding Runtime infrastructure.
Type of Change
Technical Details
Key implementation decisions:
GateDecision/compat_gate_decisioncompatibility paths from the active Core API.ControlTimeQueueReevaluationContextandCoreDecisionContext.OrderStateEventlifecycle and related schema artifacts.RiskEngineinto a policy-only component.ExecutionControlresponsible for queue/rate/inflight/sendability andControlSchedulingObligationderivation.tradingchassis_core.__init__.ExecutionControl,RiskEngine, and utilities.run_core_wakeup_stepsemantics:EventStreamEntryvalues.CoreStepResultis returned.CoreWakeupStrategyContextandCoreWakeupStrategyEvaluator.ControlTimeEvent/ControlSchedulingObligationsemantics:Determinism & Reproducibility
The Core pipeline remains deterministic.
ProcessingPositionand orderedEventStreamEntryvalues define event order.run_core_wakeup_stepnow provides stronger deterministic batch semantics by reducing all entries before a single Strategy evaluation and single decision pass.Performance Impact
No dedicated benchmarks were added. The refactor focuses on architecture, API cleanup, determinism, typing, tests, and package readiness.
Tests
Validation performed across the cleaned Core package included:
Test coverage now includes:
ControlSchedulingObligationsemanticsBreaking Changes
This is intentionally a breaking cleanup.
Removed or no longer supported as Core API:
GateDecisioncompat_gate_decisionRiskEngine.decide_intentsControlTimeQueueReevaluationContextCoreDecisionContextOrderStateEventlifecycleExternal consumers relying on legacy Core compatibility APIs must migrate to the clean CoreStep/CoreWakeupStep API:
EventStreamEntryinputsrun_core_stepfor single entriesrun_core_wakeup_stepfor ordered wakeup batchesCoreStepResult.dispatchable_intentsChecklist