fix(backtest): remove BT-001A exact window restriction now that full data access is available

- Change WindowPolicy from EXACT to BOUNDED for backtest fixture
- Pass data_source to run_read_only_scenario so real data can be used
- Fix injected provider identity preservation in BacktestPageService
- Add type: ignore for BacktestHistoricalProvider protocol assignment
- Revert TypedDict change to avoid cascading type issues in pages/
- Update tests to reflect new BOUNDED policy behavior
This commit is contained in:
Bu5hm4nn
2026-03-30 08:57:15 +02:00
parent 8e1aa4ad26
commit 70b09cbf0b
6 changed files with 26 additions and 20 deletions

View File

@@ -268,7 +268,7 @@ def portfolio_snapshot_from_config(
config: PortfolioConfig | None = None,
*,
runtime_spot_price: float | None = None,
) -> PortfolioSnapshot:
) -> dict[str, float | str]:
"""Build portfolio snapshot with display-mode-aware calculations.
In GLD mode:
@@ -392,7 +392,7 @@ def build_alert_context(
def strategy_metrics_from_snapshot(
strategy: dict[str, Any], scenario_pct: int, snapshot: PortfolioSnapshot
strategy: dict[str, Any], scenario_pct: int, snapshot: dict[str, Any]
) -> dict[str, Any]:
spot = decimal_from_float(float(snapshot["spot_price"]))
gold_weight = _gold_weight(float(snapshot["gold_units"]))