Conversation
…tic_holdings to prevent real instrument scaling config leaking into unit test
…import), not timeseries_helpers
…issue-2565 Fix VaR inputs for cash and scaled prices
…ed scoped S3 grants (#2574)
…DK permission tests (#2574)
…from Refresh and Trading (S3 access is by known key, no enumeration needed)
…, Trading=get only, no ListBucket for scheduled functions)
…ote on PolicyDocument key)
…issue-#2570 Tighten Lambda S3 IAM scope and add CDK permission assertions
d81c9ea
into
codex/add-reportsectionschema-for-portfolio-sections
GPT AI Code Review1. Acceptance criteriaThe PR does not have any linked issue or acceptance criteria, but the changes made in the code appear to be well-scoped and complete. The new sections for portfolio reporting (overview, sectors, regions, concentration, and VaR) are clearly defined and implemented. The addition of these sections aligns with the goal of enhancing the reporting capabilities of the application. 2. Bugs and logic errorsThe code appears to be logically sound, with appropriate error handling for cases where the portfolio or risk modules are not available. However, there are a few areas to consider:
3. API, data, and workflow safetyThe changes made in the backend should not break the existing frontend/backend contracts, as the new report sections are added without altering existing data structures. The new sections are well-defined and should integrate smoothly with the existing reporting framework. However, it is essential to ensure that the frontend is updated to handle these new sections correctly, as there are no changes in the payload shapes that would cause issues. There are no apparent risks to local smoke tests, deployment workflows, or repository scripts. The code does not expose any secrets or permissions issues. 4. Test coverageThe new test case
5. Minor issues (optional)
Summary Verdict: APPROVE Reviewed by GPT via gpt-pr-review.yml. Advisory only. |
Claude AI Code ReviewPR Review: "rebase"1. Acceptance criteriaNo linked issue. Reviewing on merits. The PR bundles three distinct concerns:
All three appear internally consistent and the changes are self-described. No obvious gaps relative to the stated intent. 2. Bugs and logic errors
The NaN-dropping behavior for CASH.GBP creates an index alignment hazard. For non-cash tickers,
ts = portfolio_utils.load_meta_timeseries(sym, exch, days)
if ts is None or ts.empty:
continue
scale = portfolio_utils.get_scaling_override(sym, exch, requested_scaling=None)
ts = portfolio_utils.apply_scaling(ts, scale)
if ticker.strip().upper() == "CASH.GBP":
ts = ts.copy()
ts["Close"] = 1.0
var_single = portfolio_utils.compute_var(ts, confidence=confidence)
is_cash = ticker.strip().upper() == "CASH.GBP"
More importantly:
After closes = pd.to_numeric(ts["Close"], errors="coerce").dropna()...this
The new expectation
The test asserts dates Actually, This is a potential bug in the test or the implementation. The test asserts 2024-01-02 is absent but the cash synthetic close of 1.0 × 1 unit = 1.0 should appear for that date unless the post-processing specifically requires all holdings to contribute on a given date. Needs investigation before merge. 3. API, data, and workflow safetyIAM refactor — The old code called `data_bucket Reviewed by Claude via claude-pr-review.yml. Advisory only. |
No description provided.