fix(risk): close Global ETF evidence gaps - #304
Conversation
Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 230084b6cf
ℹ️ 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".
| value = portfolio_snapshot.metadata.get("completed_session_equity") | ||
| else: | ||
| return None | ||
| completed_equity = _finite_number(value) |
There was a problem hiding this comment.
Reject oversized completed-equity integers before conversion
When a Global ETF snapshot supplies completed_session_equity as an arbitrarily large integer (for example, 10**400, which Python's JSON decoder accepts), _finite_number calls float(value) and raises OverflowError. This escapes assess_with_evidence instead of producing the intended fail-closed invalid_completed_session_equity rejection, so the new evidence boundary can still crash on malformed input.
Useful? React with 👍 / 👎.
Summary
completed_session_equityin currency terms and include that normalized value in the portfolio evidence digestExact corrective scope
r3741333381andr3741333385src/quant_platform_kit/risk/gate.pyandtests/test_risk_gate.pyRESEARCH_ONLYwithexecution_authorized=false; no runtime or order authorityEvidence