Improve backtest lazy loading and test automation

This commit is contained in:
Bu5hm4nn
2026-04-07 12:18:50 +02:00
parent ccc10923d9
commit b2bc4db41a
18 changed files with 504 additions and 300 deletions

View File

@@ -1,5 +1,5 @@
version: 1
updated_at: 2026-03-29
updated_at: 2026-04-07
structure:
backlog_dir: docs/roadmap/backlog
in_progress_dir: docs/roadmap/in-progress
@@ -13,16 +13,18 @@ notes:
- Pre-alpha policy: we may cut or replace old features without backward compatibility until alpha is declared.
- Alpha migration policy: once alpha is declared, compatibility only needs to move forward; backward migrations are not required.
priority_queue:
- EXEC-002
- DATA-DB-005
- DATA-DB-007
- DATA-002A
- DATA-001A
- DATA-DB-005
- OPS-001
- BT-003
- BT-002A
- GCF-001
- DATA-DB-006
- EXEC-002
recently_completed:
- UX-002
- BT-004
- BT-005
- CORE-003
@@ -50,15 +52,16 @@ recently_completed:
- CORE-002B
states:
backlog:
- DATA-DB-007
- DATA-DB-005
- DATA-DB-006
- EXEC-002
- DATA-002A
- DATA-001A
- OPS-001
- BT-003
- BT-002A
- GCF-001
- EXEC-002
in_progress: []
done:
- BT-004
@@ -109,5 +112,6 @@ states:
- CORE-002B
- CORE-002C
- UX-001
- UX-002
blocked: []
cancelled: []

View File

@@ -0,0 +1,20 @@
id: DATA-DB-007
title: Databento GC Contract Mapping for Backtests
status: backlog
priority: P1
effort: M
depends_on:
- DATA-DB-001
tags:
- databento
- futures
- backtests
summary: Add real Databento futures contract mapping for GC backtests so the page can support gold futures without fail-closed restrictions.
acceptance_criteria:
- Backtest-page Databento runs support GC without requiring users to know raw contract symbols.
- Contract selection or front-month rollover rules are explicit and test-covered.
- The selected contract path yields non-empty historical price data for supported windows.
- Browser validation confirms the GC path works from `/{workspace_id}/backtests` with no visible runtime error.
technical_notes:
- Current hardening work intentionally fail-closes GC on the backtest page because the raw `GC` symbol does not resolve reliably in Databento historical requests.
- Follow-up work should decide between explicit contract selection, continuous mapping, or deterministic rollover logic before re-enabling GC in the Databento path.

View File

@@ -0,0 +1,20 @@
id: UX-002
title: Backtests Lazy Preview Loading
status: done
priority: P1
effort: M
depends_on:
- UX-001
tags:
- ui
- performance
- backtests
- databento
summary: Make the backtests page render immediately by deferring expensive preview metadata until the user requests it, while hardening the Databento path used by the page.
completed_notes:
- Replaced the eager backtest-page entry-spot derivation on first paint with an explicit lazy `Load scenario preview` flow so `/{workspace_id}/backtests` renders immediately.
- Added clear lazy-loading UI copy plus a spinner/status area for preview metadata, and kept expensive Databento lookups off normal form changes.
- Updated the backtest-page defaults to use a recent completed Monday-Friday window instead of future placeholder dates.
- Bound the visible Databento dataset to the selected symbol, limited the backtest page to daily Databento bars, and fail-closed unsupported GC futures requests instead of pretending the combination works.
- Added live Databento test coverage gated by `DATABENTO_API_KEY` for both the raw source and the backtest-page service.
- Local validation covered the exact changed route: `/health` returned OK, targeted Playwright tests for `/backtests` passed, and a browser-visible manual preview run against the dev Databento key confirmed lazy preview loading plus successful GLD preview fetches.