Skip to content

refactor: split platform entry into route modules - #741

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

Pigbibi merged 8 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.
  • 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: 65 passed; 1 failed
    (test_health_route_returns_ok) also fails on origin/main due to
    local env pin (quant_platform_kit.strategy_contracts missing) — not a
    split regression.

Why

Prior #738 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:51:32.062183Z 239a5be New commits
🔒 Security Review ✅ Completed 2026-11-13T20:52:07.192652Z 239a5be 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: 0031721e66

ℹ️ 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
Align LongBridge entry with explicit re-export facade and point i18n
extract tests at notifications_runtime after the split.

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. and 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>

@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: 3a59303a7c

ℹ️ 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 main.py Resolved
Pigbibi and others added 2 commits November 14, 2026 04:39
http_routes entry proxy now accepts script launch as __main__, and
py-modules lists the extracted runtime modules for installed imports.

Co-authored-by: Cursor <cursoragent@cursor.com>
Script launches and facade-qualified notification helpers need the same
entrypoint resolution and a main stand-in for source extraction tests.

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

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

ℹ️ 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 main.py Resolved
Stop forwarding setattr into implementation modules so patch.object
deletion returns __getattr__ to the real callables.

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
@Pigbibi
Pigbibi merged commit 6b032ba into main Nov 13, 2026
20 of 24 checks passed
@Pigbibi
Pigbibi deleted the refactor/untangle-wave2 branch November 13, 2026 20:55
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