Skip to content

fix: bind declared runtime account before portfolio execution - #343

Merged
Pigbibi merged 1 commit into
mainfrom
codex/firstrade-runtime-selector-guard-20261002
Oct 2, 2026
Merged

Pigbibi merged 1 commit into
mainfrom
codex/firstrade-runtime-selector-guard-20261002

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Use the single declared runtime target account selector instead of relying on an unrelated direct setting or automatic account choice.
  • Reject missing or ambiguous declarations and conflicting direct configuration before constructing a broker client.
  • Verify that the configured account appears exactly once in the already-read account list and that selection returns that account before strategy, portfolio or order work.
  • Keep fixed error messages free of account values, preserve legacy calls without a declared runtime target, and preserve the unsupported-strategy early return.

Validation

  • 120 focused tests passed across rebalance orchestration, broker client and runtime configuration.
  • Regression cases cover pre-connection rejection, native account mismatch, invalid selection, positive and legacy paths, and unsupported-strategy behavior.
  • Ruff and diff checks passed; installed shared dependency refs match the lock, with the existing broker SDK unchanged.
  • Independent scoped review identified the early-return ordering issue. The correction and its regression cases were verified.

Runtime boundary

Source repair only. No deployment, broker request, authentication change, trading activation, production configuration change or financial publication is included. This does not qualify heuristic cash or account-list total value as portfolio NAV.

Co-Authored-By: Codex <noreply@openai.com>
@Pigbibi
Pigbibi merged commit 883fea9 into main Oct 2, 2026
1 check passed
@Pigbibi
Pigbibi deleted the codex/firstrade-runtime-selector-guard-20261002 branch October 2, 2026 06:46
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