Commit Graph
1 Commits
Author SHA1 Message Date
ImBenjiandClaude Opus 5 a4cf6462d0 fix: one bad SPY fetch stopped outcome scoring for nineteen days
The outcome worker kept one price series per symbol in a map that never expired,
and on the null path it only ever dropped the instrument, never the benchmark. So
a single degraded-but-200 SPY response poisoned the benchmark for the whole life
of the worker. calculateOutcome then returned null for every symbol, and each
matured prediction got retired as "no market data" the moment its grace ran out.

Outcomes stopped dead on 2026-09-20. Three unrelated tickers failing in the same
pass was the tell. I ran calculateOutcome against the exact predictions the worker
was retiring and all three scored fine, with GSBC sitting there on yahoo with
6,732 bars through yesterday. Nothing was ever missing.

Fourth time now that unmanaged state in a long lived loop has quietly broken this
pipeline, so the cache gets a ttl, a dud series is treated as a failed fetch
rather than cached as though it were real, and the benchmark is dropped alongside
the instrument when a score comes back empty.

The guard that actually matters is coversHorizon. A prediction is only retired
when the prices we hold genuinely reach its horizon. If the series stops short
then the exit bar has not published yet, which is a hole in what we fetched and
not a prediction nobody can score. That distinction is the whole bug.

scripts/repair-unresolvable-outcomes.js re-asks every mislabeled row with fresh
data and leaves anything genuinely unscorable alone. Dry run by default, writes
through openRuntimeDb so it honours the configured backend, and prints row counts
either side.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-10-09 14:13:32 +01:00