4.8 KiB
R07 — Deliver sweep configuration and comparable-result views
Parent epic: E6. Priority/severity: P1 / High. Relative complexity: M. Recommended specialization: Full-stack research product.
Scheduling source of truth: manifest entry R07. No task is authorized until the plan is approved. Dependencies and decision references below describe the design; the manifest controls current readiness.
Evidence and root cause
- WEB-01 — Verified: The real backtest list/detail/API/SQL flow already exists. Strategy/project/experiment work should extend it; App strategy/analytics views are placeholders. apps/stock/web-app/src/app/App.tsx:24; apps/stock/web-api/src/services/backtest-v2.service.ts:211.
- FIN-07 — Verified: Daily return grouping, Sharpe/Sortino conventions and placeholder exposure/VaR produce incomparable or misleading native metrics. apps/stock/engine/src/backtest/simple_results.rs:374; apps/stock/engine/src/backtest/simple_results.rs:542.
- WEB-04 — Verified: Existing results snapshot configuration and datasets but do not capture an immutable strategy artifact/engine build/model/seed bundle. Legacy projection can fall back to mutable definition fields. libs/core/types/src/backtest-run.ts:4; apps/stock/web-api/src/services/backtest-result.ts:107.
Intended behavior and implementation scope
Deliver experiment preview/progress/comparison directly on R06 APIs. Accept an existing frozen dataset ID and show its manifest; R11's picker is optional convenience, not a prerequisite. A project/workspace link is optional; users need not build project metadata before comparing a sweep. Reuse current charts/metrics and R06 summary projection.
Exclusions
No general workflow framework, browser IDE, multi-tenant identity platform or second simulator.
Likely files and ownership
- apps/stock/web-app/src/features/experiments/ (new)
- apps/stock/web-app/src/features/backtest/components/
- apps/stock/web-app/src/components/ui/DataTable/
Write locks: web-experiments. One agent owns this change. Lock names do not override actual overlapping files.
Dependencies and blockers
Implementation requires R06 integrated.
Architecture decisions: ADR-006. Agents may not independently amend their policies.
Feature activation/release gates: W04. These do not block implementing or integrating this component against its own tests.
Parallel eligibility: only with disjoint actual files and reserved write locks; read FIRST-WAVE.md for the initial exact ownership boundaries.
Acceptance criteria
- User previews bounded trial count, submits, sees all statuses, cancels and opens exact candidate runs.
- Default comparison requires matching data, execution/metrics policy, costs and evaluation windows; mismatches remain visible, not silently ranked.
- No full detail blobs on summary list; failed/incomplete counts and null metrics are explicit.
Mandatory tests
- sweep_to_compare_browser, mixed_policy_warning, partial_failure_visibility, reopen_experiment.
- Large result table rendering measurement and metric-null tests.
Apply the relevant quality gates; submit exact commands, outcomes and skipped checks. Named cases above are required regression scenarios, not claims that those tests already exist.
Regression risks and rollback
Schema/API backward compatibility, historical provenance and UI state regression. Keep migrations additive and previous results readable. Do not add a switch that restores a correctness defect. Versioned cutover/migration is required only when persisted contracts or active engines change; never silently fall back to old economics.
Web/API contract and user states
- API: R06 experiment/trial listing; summary metrics projection from result contracts; pagination where needed.
- Backend/data dependencies: Experiments and canonical provenance; full trade arrays are fetched only on run detail.
- Loading/error/empty behavior: Preview loading; invalid grid errors; empty not-yet-submitted; per-trial failed/cancelled; retryable aggregate errors.
- User-facing completion is demonstrated by the acceptance criteria and interaction tests above; a backend-only implementation is insufficient where a UI is in scope.
Handoff
Report scope changes (if any), fixture expectations, API/schema changes, measurements, remaining limitations and commit/PR references once authorized. Request independent review; only the integration/planning owner may mark the manifest done.