Skip to content

fix: preserve IBKR fill time and currency - #781

Merged
Pigbibi merged 1 commit into
mainfrom
fix/retain-fill-time-currency
Nov 10, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
fix/retain-fill-time-currency

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Preserve each IBKR execution's normalized UTC time and validated contract currency in OutcomeFill. Previously settlement consumers received only execution ID, quantity and price. Keep legacy three-argument construction through optional defaults, and reject duplicate execution IDs whose currencies conflict.

Changes

  • Add optional occurred_at and currency fields; accept only three uppercase ASCII letters for currency and retain None for absent/invalid values.
  • Reuse existing UTC conversion and complete-record duplicate checks.
  • Cover legacy construction, JSON serialization, UTC conversion, missing/invalid currency, conflicting currency/time and equivalent-timezone deduplication.

Validation

  • Tests-first: 11 failures and 1 existing pass before source modification; metadata preservation and conflicting currency fail before and pass after.

  • Order-outcome and real SDK decoder tests: 87 passed.

  • Full suite: 4077 passed, 3 skipped, 1277 passing subtests (Python 3.11, TZ=UTC, actual main SHA in GITHUB_SHA). The original local-time/missing-provenance run had 4 environment failures; both affected test files passed 39 tests after matching CI environment values..

  • Ruff and git diff --check passed. Documentation style: zero blockers, one existing README advisory.

  • Complete tracked-tree central publication-check result: publication-check/2.0-advisory (build 83d9d1130377), advisory; 1185 matches across 203 files / 1180 matching lines. Existing-tree matches do not grant approval and are not automatically blocking under the task's publication policy. First 20 masked matches:

  • repo/.github/CODEOWNERS:2: /.github/CODEOWNERS @<PROJECT_ID>

  • repo/.github/CODEOWNERS:3: /src/quant_platform_kit/risk/ @<PROJECT_ID>

  • repo/.github/CODEOWNERS:4: /src/quant_platform_kit/binance/ @<PROJECT_ID>

  • repo/.github/CODEOWNERS:5: /src/quant_platform_kit/ibkr/ @<PROJECT_ID>

  • repo/.github/CODEOWNERS:6: /src/quant_platform_kit/longbridge/ @<PROJECT_ID>

  • repo/.github/CODEOWNERS:7: /src/quant_platform_kit/schwab/ @<PROJECT_ID>

  • repo/.github/CODEOWNERS:8: /src/quant_platform_kit/common/models.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:9: /src/quant_platform_kit/common/port_adapters.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:10: /src/quant_platform_kit/common/execution_translation.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:11: /src/quant_platform_kit/position_sizing.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:16: /scripts/verify_fractional_dca_execution.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:17: /src/quant_platform_kit/binance/execution.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:18: /src/quant_platform_kit/common/account_risk_budget.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:19: /src/quant_platform_kit/common/execution_capabilities.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:20: /src/quant_platform_kit/common/execution_commands.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:21: /src/quant_platform_kit/common/execution_fills.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:22: /src/quant_platform_kit/common/execution_outcomes.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:23: /src/quant_platform_kit/common/execution_receipts.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:24: /src/quant_platform_kit/common/execution_state.py @<PROJECT_ID>

  • repo/.github/CODEOWNERS:25: /src/quant_platform_kit/common/paper_execution_admission.py @<PROJECT_ID>.

Compatibility and scope

Serialized fill dictionaries gain optional fields, including null defaults. Legacy persisted IBKR terminal observations require consumer compatibility handling before a later dependency pin bump. This PR changes only the resolver and its tests; no downstream pin or consumer rollout is included.

Ordinary feature branch; QPK_PIN and workflows are unchanged. Pin-update and downstream mutation workflows are not dispatched. No merge, deployment, activation, production configuration, secret/IAM, PAPER/live or protected-switch action is included. Runtime adoption remains unverified.

AI authorship

Prepared with OpenAI Codex (GPT-6).

@Pigbibi
Pigbibi marked this pull request as ready for review November 9, 2026 20:25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T20:26:52.463446Z 789f444 Draft marked ready
🔒 Security Review ✅ Completed 2026-11-09T20:28:35.757065Z 789f444 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Pigbibi Pigbibi added the agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation label Nov 10, 2026 — with Cursor
@Pigbibi
Pigbibi merged commit bc9eac7 into main Nov 10, 2026
13 of 15 checks passed
@Pigbibi
Pigbibi deleted the fix/retain-fill-time-currency branch November 10, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants