2.6 KiB
RP12 — Keep run history usable while result metrics load
Parent E12. Priority P2 / Medium recovery defect. Complexity S. Dependency W01. Owner continuation authorizes this correction.
Verified baseline: RunsListWithMetrics.tsx waits for every completed result before publishing any rows and passes a blocking loading state to DataTable. One delayed result hides already-loaded failed/active run rows. useRunMonitoring.ts replaces the runs array on each active poll, restarting the reads. The existing HappyDOM/Virtuoso harness reproduces zero selectable rows while two run records are already available; /tmp/stock-bot-rp12-baseline.log records the failure.
Scope: render authoritative current run records immediately and enrich their metrics independently by run/backtest identity. A pending or failed result must not hide other rows or replace current status. Preserve honest unavailable values, canonical/legacy display conventions, identity validation and stale-response fencing. Keep the fix local to the history component; no result-summary endpoint, shared table redesign, global cache or financial/throughput optimization.
Ownership: implementation agent owns apps/stock/web-app/src/features/backtest/components/RunsListWithMetrics.tsx and test/integration/canonical-workbench.test.tsx. Root owns shared browser tests, planning state and commits. Parallel with RP11; independent review required.
Acceptance/tests: all current rows remain visible/selectable while result reads are pending or failed. Polling updates status without hiding history or starving unchanged result reads. Healthy metrics become visible without waiting for unrelated reads. Removed/changed-parent rows and late unmounted reads cannot restore obsolete data. Failed reads have an honest local state and an explicit local retry. Preserve existing foreign-parent rejection and canonical/legacy drawdown tests. Browser: delay a completed result and open another saved run without creating a new one.
Gates: focused canonical workbench regressions, application/authored types, lint/build, root repository check and browser delayed-result navigation. No backend, accounting or API changes.
Accepted October 27, 2026; implementation a050c710. Independent review passed 41 focused tests / 344 assertions. Root repository check passed, including 1,347 integration and 150 Rust tests. Complete Chromium suite passed all 21 scenarios / 750 assertions, including the actual partial-read browser regression. Application/authored types, strict lint, formatting and builds passed. Combined evidence records the gates and limitations.