Skip to content

Repair Rust portfolio module placement/integration and restore portfolio Monte Carlo build path#1

Draft
Copilot wants to merge 1 commit intomainfrom
copilot/check-portfolio-assets-functionality
Draft

Repair Rust portfolio module placement/integration and restore portfolio Monte Carlo build path#1
Copilot wants to merge 1 commit intomainfrom
copilot/check-portfolio-assets-functionality

Conversation

Copy link
Copy Markdown

Copilot AI commented May 7, 2026

mc_portfolio.rs was not loadable by the crate due to a malformed filesystem path, so portfolio Monte Carlo logic (asset/scenario structs, correlation/draw/aggregation pipeline, VaR/CVaR, diversification metrics) existed but was effectively disconnected from the build. This PR restores a valid module layout and wires portfolio functionality into the Rust crate/PyO3 surface.

  • Module restoration

    • Moves portfolio implementation into a valid Rust source file path: data-engine/rust/src/mc_portfolio.rs.
    • Removes malformed newline/tree-character path artifacts that prevented module resolution.
  • Crate integration

    • Adds mod mc_portfolio; and imports required portfolio types/functions in lib.rs.
    • Exposes portfolio entry points through PyO3 so portfolio simulation and stress APIs are reachable from Python.
  • Type and API alignment

    • Ensures portfolio scenario typing is consistent (PortfolioScenario/result structs) and matches call sites.
    • Normalizes naming and references for portfolio VaR/CVaR and diversification outputs.
  • Dependency/module consistency fixes

    • Aligns module naming (distribution vs distributions) and dependency declarations needed by the restored portfolio path (serde/serde_json, RNG feature compatibility).
// lib.rs
mod mc_portfolio;

use mc_portfolio::{PortfolioAsset, run_portfolio, run_single_portfolio_scenario};

…lio Monte Carlo build path

Agent-Logs-Url: https://github.com/devXyi/prexus-intelligence/sessions/554060aa-04af-4fa2-90b1-1511af0bb84e

Co-authored-by: devXyi <265634822+devXyi@users.noreply.github.com>
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.

2 participants