Skip to content

Fix intraday filled-order cap accounting#107

Merged
luisleo526 merged 1 commit into
mainfrom
codex/regime-intraday-fill-cap-2x2
Jul 15, 2026
Merged

Fix intraday filled-order cap accounting#107
luisleo526 merged 1 commit into
mainfrom
codex/regime-intraday-fill-cap-2x2

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Summary

  • avoid charging max_intraday_filled_orders for same-direction MARKET attempts that cannot change a position already at its pyramiding cap
  • defer the ordinary historical POOC risk flatten to the next broker boundary when the cap-triggering MARKET filled at the signal close
  • count full POOC strategy.close fills while allowing one exact co-queued reversal incarnation to share that broker-event identity
  • add direction-symmetric and adversarial coverage for rejection, cancellation, no-op, intervening fills, scheduler exclusions, day latching, and reset behavior

All three compatibility switches are default-off and require explicit positive finite metadata, so existing executions remain unchanged unless a validated route opts in.

Root cause

The engine treated three distinct broker events as one accounting problem: a consumed MARKET command that did not fill, a synthetic cap close scheduled on the wrong POOC boundary, and a full strategy.close that bypassed the ordinary fill counter. Fixing only one exposed the others. The implementation keeps the mechanisms independently toggleable and binds reversal inheritance to one fresh order incarnation so rejected, cancelled, replaced, or intervened orders cannot reuse quota.

Validation

  • factorial interaction gate: all 8 cells passed; only all-on reached fully exact 766/766 raw chronology
  • focused intraday-cap checks: 127/127
  • engine CTest: 104/104
  • public C ABI and exported-symbol comparison: pass
  • pinned codegen: 1,537 passed / 2 skipped
  • corpus: 252/252, unchanged at 243 Excellent / 8 Strong / 1 Anomaly
  • verifier self-test 4/4; fingerprint 52/52; report lock-step 252/252
  • forced-no-cache community sweep: 412 accounted (403 OK, 1 no-trades, 7 known transpile errors, 0 compile errors, 1 known run error), exactly 1 tier upgrade and 0 downgrades
  • two independent source/scope reviews plus fresh-context R7: PASS

@luisleo526 luisleo526 merged commit 71ba561 into main Jul 15, 2026
5 checks passed
@luisleo526 luisleo526 deleted the codex/regime-intraday-fill-cap-2x2 branch July 15, 2026 21:47
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