Repository navigation
fix: enforce execution windows and sparse-feed deadlines - #7
Merged
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.
Delayed parent starts previously caused replay time-travel errors, while pre-start trades and post-window markout observations contaminated participation and arrival/terminal benchmarks. Without an event exactly at the deadline, later market data could also trigger a terminal sweep after the order window.
Replay earlier events to rebuild the book and causal features without submitting orders, establishing arrival or accumulating execution volume. Policies receive volume measured from the parent start; window boundaries remain inclusive. Before consuming post-window data, advance an internal deadline clock, drain actions due by the deadline and close from the last observable in-window state/book. Preserve the true last-observed timestamp. If no in-window state exists, do not invent a quote or sweep. Later observations continue to support markouts without changing execution volume or benchmarks.
Book and fee protocols live in an execution port so the simulator remains within the 600-line architecture limit. The execution guide documents the warm-up, boundary and sparse-feed behavior.
Validation: all six normalized-CSV harness regressions passed independently, covering delayed TWAP/POV, streams ending before the start, post-window markouts, a missing exact-deadline tick and no observable in-window quote. The complete deterministic CLI demo ran successfully; its participation values are refreshed in #8. All six final-head CI jobs passed: https://github.com/dev-belly/TradeForge/actions/runs/37712196848 . After merging as
1ba71290dcc734a618e322b0cf9da6b1398adf62, all six main CI jobs also passed: https://github.com/dev-belly/TradeForge/actions/runs/37738744500 . These cover Python 3.11–3.13, lint/format/types, architecture/leakage checks, native unit/differential checks, ASan/UBSan and deterministic replay.