Skip to content

feat: Resolve IBKR order outcomes without assuming fills - #772

Merged
Pigbibi merged 8 commits into
mainfrom
feat/ibkr-order-outcome-compatible-r2
Nov 3, 2026
Merged

Pigbibi merged 8 commits into
mainfrom
feat/ibkr-order-outcome-compatible-r2

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add read-only IBKR order outcomes so acknowledged submissions can be reported from broker-confirmed facts without assuming fills. Reject incomplete snapshots when the SDK decoder catches a decoding exception, and suppress its raw diagnostics.

Changes

  • Add immutable outcome/fill contracts and an identity-bound resolver over open orders, completed orders and executions; preserve the existing submission API.
  • Require positive permanent-ID binding for timeless terminals; include commission currency in duplicate comparison and leave mixed-currency aggregate fees unknown.
  • Extend the bounded read guard to the SDK decoder logger. Decoder errors fail the observation even without errorEvent and with logging disabled; raw messages and tracebacks are suppressed. Restore loggers and listeners on every exit.
  • Add synthetic sink and actual-SDK regressions, including valid decoding, three read phases and recovery after a failed observation. Document the read failure contract.

Verification

Decoder repair fail-before: 10 failures / 5 controls pass, plus 6 unconditional sink failures. After repair: 92 focused cases pass, including unchanged decoder and previous review probes. Full offline suite: 3938 passed, 2 skipped, plus 1277 subtests. Actual ib_insync 0.9.86 probes run under inherited network denial; wheel checks use cached offline wheels. Ruff, documentation blocking checks, whitespace and identifier scans pass. SDK integration tests skip only when that optional SDK is absent; unconditional core sink tests remain active.

Risk and rollback

R2. Failed source reads raise the fixed OrderOutcomeReadError; missing or conflicting evidence stays unknown. No public signature/schema, execution authority, scheduler, dependency pin, production configuration or trading/risk switch changes. No broker or Gateway connection, deployment or consumer activation. Exclusive private-connection reads and deadlines remain consumer responsibilities. Runtime, adoption and real delivery are NOT_PROVEN. Owner risk approval and established exact-head review remain required. Rollback, if approved, is a normal revert; no history rewrite.

AI assistance

Implemented with OpenAI Codex (gpt-6.1-sol). Author self-review and adverse tests completed; independent review and merge remain with the established review-and-merge bot.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bcdd31fa-a529-4843-94ae-100591423d25
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@Pigbibi Pigbibi added the owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. label Nov 3, 2026
@Pigbibi
Pigbibi marked this pull request as ready for review November 3, 2026 00:58
@Pigbibi
Pigbibi merged commit 436ea66 into main Nov 3, 2026
9 of 12 checks passed
@Pigbibi
Pigbibi deleted the feat/ibkr-order-outcome-compatible-r2 branch November 3, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants