Skip to content

refactor: split platform entry into route modules - #1005

Merged
Pigbibi merged 9 commits into
mainfrom
refactor/untangle-wave2
Nov 13, 2026
Merged

Pigbibi merged 9 commits into
mainfrom
refactor/untangle-wave2

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

AI assistance

Cursor Auto (Composer) with local agent session. Owner authorized commit,
push, and PR for untangle Wave2.

What changed

  • Structure-only fat-main.py split into http_routes, runtime_wiring,
    notifications_runtime, and strategy_plugins_runtime.
  • main.py is a Binance-style thin facade: explicit named re-exports
    only (no import * / _export), plus a module facade that forwards
    attribute writes to the owning implementation module.
  • Flask / application imports no longer live on main.
  • Existing application/http_routes.py helpers remain; top-level Flask app
    and cycle runners move out of main.
  • Monkeypatch-friendly via facade sync + main.<name> proxy in split
    modules; split modules reload when main reloads.
  • No intentional change to HTTP/CLI contracts or order semantics.

How verified

  • AST parse + compileall on split modules.
  • pytest tests/test_request_handling.py errors on both this branch and
    origin/main for missing local pin ib_insync — env issue, not a split
    regression. No new failure delta vs baseline under the same PYTHONPATH.

Why

Prior #1002 closed after import * / _export public surface caused real
regressions. Wave2 redo follows the Binance thin-main pattern so tests and
process entry keep a stable, patchable main surface.

Risk

Low structure-only refactor. Labels: agent-approved + risk:low only.

Keep main as an explicit named re-export surface for tests and process
entry, with routes and wiring moved into dedicated modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi Pigbibi added risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative. agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation labels Nov 13, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T20:57:55.436012Z 7783597 New commits
🔒 Security Review ✅ Completed 2026-11-13T21:00:21.401292Z 7783597 New commits
ℹ️ 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.

@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: 9ff2e2e8c0

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

Comment thread http_routes.py Resolved
Comment thread main.py Resolved
Comment thread http_routes.py Resolved
Comment thread runtime_wiring.py Resolved
Align IBKR entry with explicit re-export facade and point i18n/handler
extract tests at notifications_runtime and http_routes after the split.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi Pigbibi removed risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative. agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation labels Nov 13, 2026
Align with Binance Wave2: main is a named-export module facade only,
with Flask/wiring living in split modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi Pigbibi added agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative. labels Nov 13, 2026

@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: 3368ed99d5

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

Comment thread tests/test_runtime_notification_i18n.py Resolved
Pigbibi and others added 2 commits November 14, 2026 04:39
Keep facade IB_HOST authoritative, resolve __main__ entry, pass the
main facade into settlement, and ship split modules in py-modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
Keep script-launch entry resolution consistent with http_routes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi Pigbibi added agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation and removed agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation labels Nov 13, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>

@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: bb6f94518c

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

Comment thread runtime_wiring.py Resolved

@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: cbbd7f7fee

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

Comment thread runtime_wiring.py Resolved
@Pigbibi Pigbibi added agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation and removed agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation labels Nov 13, 2026
runtime_wiring and strategy_plugins_runtime must find the script
entrypoint facade so composer/plugin helpers resolve across modules.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi
Pigbibi enabled auto-merge November 13, 2026 20:56
@Pigbibi Pigbibi added agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation and removed agent-approved An agent cleared this high-risk change on the current head; not an owner confirmation labels Nov 13, 2026
@Pigbibi
Pigbibi merged commit eb2f1c8 into main Nov 13, 2026
22 of 25 checks passed
@Pigbibi
Pigbibi deleted the refactor/untangle-wave2 branch November 13, 2026 20:58
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 risk:low Documentation, tests or ordinary checks; automated path classification remains authoritative.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant