Skip to content

fix: cancel in-flight children before terminal sweeps - #9

Merged
dev-belly merged 1 commit into
mainfrom
codex/20261008-inflight-cancellation
Oct 8, 2026
Merged

dev-belly merged 1 commit into
mainfrom
codex/20261008-inflight-cancellation

Conversation

@dev-belly

@dev-belly dev-belly commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

A child decided before the parent deadline but still in flight was absent from Oms.open_orders, so window cancellation missed it. Its arrival later filled alongside the replacement terminal sweep: a 100-unit parent could fill 150 units. The cancel mode could also fill 50 units after reporting that its window had closed.

Cancel all non-terminal submitted children, including orders not yet accepted by the venue. Permit the existing OMS cancellation API's NEW → CANCELLED transition and ignore arrival callbacks for terminal children. Count live children for the open-order guard so a cancelled callback does not consume capacity and block its replacement.

Eight normalized-CSV harness cases cover cancel, sweep, explicit leave, arrival exactly at the deadline, and both one-order and ten-order capacity limits. They reconcile child statuses, cancellation timestamps and fill totals; configured latency still applies to a newly submitted terminal sweep. The execution guide documents these semantics.

Validation: the complete local suite passed 836 tests with 152 skipped. Ruff lint and format passed for 134 Python files, mypy passed for 101 source files, and the eight-policy/style deterministic demo retained its recorded output. Targeted harness/domain/architecture checks also passed. The simulator remains within the 600-line architecture limit. Required remote Python 3.11–3.13, C++ differential, ASan/UBSan and reproducibility checks are tracked at https://github.com/dev-belly/TradeForge/actions/runs/37772324785 .

@dev-belly
dev-belly merged commit 4046d7e into main Oct 8, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant