Skip to content

[codex] Add IBKR dry-run report summary - #133

Merged
Pigbibi merged 3 commits into
mainfrom
codex/ibkr-dry-run-report-summary
Jun 3, 2026
Merged

[codex] Add IBKR dry-run report summary#133
Pigbibi merged 3 commits into
mainfrom
codex/ibkr-dry-run-report-summary

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Jun 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a machine-readable IBKR cycle report summary helper.
  • Include orders_previewed_count and dry_run_order_preview_available so dry-run runtime reports can feed HK live-enable evidence drafting consistently with LongBridge.
  • Keep broker order IDs and sensitive order details out of the runtime report summary.

Validation

  • python3 -m ruff check main.py tests/test_request_handling.py → passed
  • .venv/bin/python -m pytest -q tests/test_request_handling.py tests/test_runtime_reporting_adapters.py tests/test_rebalance_service.py tests/test_notifications.py tests/test_notification_events.py42 passed

Notes

  • This does not live-enable trading, deploy Cloud Run, remove dry-run controls, or place orders.
  • It only improves machine-readable dry-run evidence collection for later hk_low_vol_dividend_quality validation.

@Pigbibi
Pigbibi marked this pull request as ready for review June 3, 2026 04:09
@Pigbibi
Pigbibi merged commit d959832 into main Jun 3, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/ibkr-dry-run-report-summary branch June 3, 2026 04:09

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4deeac6203

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

recorded_delivery_events.append(
{
"sink": "telegram",
"delivery_status": "sent",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid marking failed Telegram delivery as sent

In environments where Telegram is not configured or the API returns a non-2xx response, send_tg_message/send_telegram_message returns without raising (it only logs failures), but this wrapper still appends a delivery_status: "sent" event. That makes the new dry-run evidence report claim notification delivery succeeded even when no Telegram message was actually delivered; the recorder needs an explicit success signal or should not record sent for silent/no-op failures.

Useful? React with 👍 / 👎.

Comment thread main.py
execution_summary.get("orders_skipped"),
reconciliation_record.get("orders_skipped"),
)
orders_previewed_count = orders_submitted_count if dry_run else 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count dry-run option previews in the report

When a dry run contains only option intents, execute_rebalance records those previews in execution_summary["option_orders_submitted"] and even treats them as an executed cycle, but orders_submitted remains empty. Deriving orders_previewed_count only from stock orders_submitted_count makes orders_previewed_count zero and dry_run_order_preview_available false for real option order previews, so the machine-readable dry-run report loses evidence for option-only plans.

Useful? React with 👍 / 👎.

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