Hardens the Live Playwright Reporter so duplicate starts, writes to completed runs, and clock-skewed starts no longer corrupt stats or the dashboard.
/start is now idempotent: replaying a run_id returns the existing run instead of inserting a duplicate.
/tests rejects batches for unknown (404) or completed (409) runs, and updates provisional counts on the run after each batch so the dashboard shows progress while it's running.
The reporter awaits all in-flight batches before flushing fileBuffer and retries /complete up to 3 times with exponential backoff.
Dashboard aggregates exclude running rows, and the liveness check rejects future started_at values.
The current reporter-only changes appear safe to merge.
Summary
The current diff changes only tests/e2e/stats-live-reporter.ts.
The reporter flushes leftover test results after earlier uploads finish.
The reporter retries run completion and labels runs it rejoins.
No new actionable issues were found. lane711 explicitly deferred Playwright coverage because it would add significant scope.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[onEnd] --> B[Wait for pending uploads]
B --> C[Flush remaining buffers]
C --> D[Wait for final uploads]
D --> E[Send completion]
E --> F{Succeeded?}
F -->|Yes| G[Log completion]
F -->|No, attempts remain| H[Wait before retry]
H --> E
F -->|Three failures| I[Log warning]