Skip to content

fix: enforce paired market affordability#101

Merged
luisleo526 merged 1 commit into
mainfrom
codex/pending-market-affordability
Jul 15, 2026
Merged

fix: enforce paired market affordability#101
luisleo526 merged 1 commit into
mainfrom
codex/pending-market-affordability

Conversation

@luisleo526

Copy link
Copy Markdown
Collaborator

Summary

  • finalize exactly two explicit fixed opposite MARKET entries created broker-flat on the same source bar as a paired broker transaction
  • preserve each call's own quantity while applying TradingView's gross affordability check to the later transaction
  • execute admitted pairs buy-before-sell without reordering unrelated exits
  • defer pair recognition until the complete source-bar order set is known and fence off prior resting entries, replacements, cancellation, risk, POOC, COOF, OCA, slippage, custom margins, and other unproven scopes
  • add 178 focused assertions covering decomposition, rejection, ordering, gap admission, quantization, exit reconciliation, and lifecycle safety

Root cause

The engine admitted each explicit market call using only its own quantity and then filled opposite calls in source order. The TradingView probes show that, in this narrow flat two-call scope, the later call is admitted using its own quantity plus the earlier pending opposite quantity, while an admitted pair fills buy-before-sell. This produced two proven extra Thula trades.

Impact

  • hardened affordability probe: 3,128 / 3,128 exact, 100% price parity
  • bracket control probe: 3,128 / 3,128 exact
  • precedence control remains unchanged at 6,256 / 7,429 (84.2%), 100% matched-price parity
  • Thula absolute count gap improves from 8 to 6
  • 11 non-target sentinel trade tapes remain byte-identical
  • no codegen, verifier, tier-threshold, inputs, metrics, or TradingView-oracle changes

Validation

  • independent safety audit: PASS
  • standalone engine: full build PASS; CTest 99 / 99
  • cumulative accepted engine: full build PASS; CTest 103 / 103
  • focused paired-market suite: 178 / 178
  • corpus, standalone and cumulative: 252 / 252 runtimes; 240 Excellent / 11 Strong / 1 anomaly
  • codegen header compatibility: 1,537 passed / 2 skipped
  • targeted scraper gate: 12 / 12 OK; 0 UP / 0 DOWN
  • forced no-cache full sweep: 412 accounted as 403 OK + 1 no-trades + 7 transpile errors + 0 compile errors + 1 run error
  • full board: 337 Excellent / 54 Strong / 5 Moderate / 5 Weak; 0 UP / 0 DOWN

@luisleo526 luisleo526 marked this pull request as ready for review July 15, 2026 08:37
@luisleo526 luisleo526 merged commit 8925f85 into main Jul 15, 2026
5 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