orders: assert that outside-RTH is absent when it was not asked for (ibx#352) - #359
Open
userFRM wants to merge 1 commit into
Open
orders: assert that outside-RTH is absent when it was not asked for (ibx#352)#359userFRM wants to merge 1 commit into
userFRM wants to merge 1 commit into
Conversation
Every submit encoder guards tag 6433, and nothing asserted the guard. The tests checked that the flag is present when the caller set it and never that it is absent when they did not, so making all four paths emit it unconditionally failed no test at all. That is the shape ibx#247 took on the replace path, where a hard-coded 6433 opted every modified order into the extended session and survived because the coverage could not express the direction it broke in. An order silently widened to outside regular hours fills at prices the caller never meant to trade at, and nothing in the callbacks distinguishes it from one they asked for. One test, both polarities, across all four paths that emit the tag — the three GTC variants and the shared extended encoder every attributed order routes through. It reads the bytes off a socket rather than the request enum, because the enum is not where the tag is decided. No production change: the guards were already correct. This is the assertion that keeps them so. Closes deepentropy#352.
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
Why
This is the shape #247 took on the replace path, where a hard-coded
6433=1opted every modified order into the extended session. It survived because the coverage could not express the direction it broke in — and the same blind spot is still on the submit side.An order silently widened to outside regular hours fills at prices the caller never meant to trade at, and nothing in the callbacks distinguishes it from one they asked for.
The test reads the bytes off a socket rather than inspecting the request enum, because the enum is not where the tag is decided.
No production change: the guards were already correct. This is the assertion that keeps them so.
Closes #352.
Test plan
cargo test --offline --lib— 803 passed. The 2 failures areconfig::expiry_tests::{named_zone_converts_with_dst, instant_round_trips_to_wire}, which fail on the base commit too (fixed separately in config: resolve the legacy timezone names IB states its times in (ibx#335) #336).cargo check --offlineclean on every target:--lib,--features python,--bins,--examples, and each of the eighttests/*.rstargets individually.6433unconditionally failsevery_submit_path_emits_outside_rth_only_when_it_was_asked_forby name — and so does mutating only the shared extended encoder, so the test is not passing on the strength of one path.🤖 Generated with Claude Code