2.7 KiB
RP04 — Explain the evaluation horizon and CAGR in canonical results
Parent: E12. Priority P1 / High (research interpretation). Complexity S. Dependency: RP02. Owner continuation authorizes this presentation correction. ADR-006; no financial or analytics semantic change.
Evidence: libs/research/src/results.ts computes CAGR using actual elapsed calendar time divided by 365 days. CanonicalResults.tsx shows CAGR without its evaluation duration and labels a separate policy generically as "Annualization: periods/year". RP02's five-and-a-half-hour total return of approximately -0.054575% produces -58.08% CAGR. The saved finding excludes that extrapolation, but the result UI should explain it itself.
Scope: in apps/stock/web-app/src/features/backtest/components/CanonicalResults.tsx, show retained financial reporting start/end in UTC and elapsed calendar duration. Explain alongside CAGR that it extrapolates this interval to a 365-day year, includes nontrading elapsed time, and is not an observed annual return or forecast. Clarify that periodsPerYear governs periodic statistics. Preserve existing metric values, null/reason rendering, units, result contracts, rankings, engine behavior and old saved results. No arbitrary sample cutoff, hiding/recalculation of CAGR, new warning framework or financial calculations in the frontend.
Acceptance/tests: realistic partial-session result displays exact UTC interval/duration and CAGR explanation with stored CAGR unchanged; multi-day/overnight duration is calendar elapsed time; null CAGR reason and existing fill-only view remain correct; periodic annualization label is unambiguous. Add focused production-component regression assertions in the existing result/UI suite; root may add browser assertions to its owned workbench scenario. Loading/error/empty behavior stays in the existing parent run view; no new backend/data dependency or request.
Locks: CanonicalResults and its focused result tests only. Parallel with RP03; do not modify shared workbench E2E or manifest. Gates: focused UI tests, authored test/app types, strict lint and production build, root combined check/browser gate, independent review. Regression risk low; the primary risk is misstating the existing computation's time basis.
Accepted October 27, 2026: retained UTC bounds and exact calendar duration now accompany the unchanged metrics. Independent review passed 21 UI tests / 157 assertions; the root actual-native browser smoke verifies the displayed reporting interval and explanation. Full repository check, application/authored-test types, strict lint and production build passed. Combined evidence records final integration results and test-run limitations.