What broke
The stored fund forecast was not the one the page showed
The stock app's fund forecast saved only the day's first calculation, so the stored row said +0.633 while the page showed +0.233. The gap was measured on 5 August 2026. The fix updates the row only until the forecast has matured.
The short version
What went wrongThe save function ignored later runs for the same fund and date, so the stored forecast (+0.633) differed from the one the page showed (+0.233). Nothing raised an error.
How we found itAfter the first nightly job, Claude compared the stored row with the page numbers and found +0.633 and 35.9 % against +0.233 and 67.2 %.
The rule nowUpdate a stored forecast only while it has not matured; once the answer is known, freeze it. Confirm a job ran by its effect in the data, not by an unchecked status field.
This post documents something Claude got wrong. The claim rests on a commit or a file, not on memory. All of Claude's mistakes
The stock app has a module that makes a forecast for each of six funds and writes it down, so it can later be scored against what the fund actually did. The module exists to measure its own predictions. That only works if the forecast it stores is the one it actually made.
On 5 August 2026 it wasn’t. The stored row for one of the funds had an aggregate score of +0.633 and a coverage of 35.9 %. The page showed +0.233 and 67.2 %. Nothing raised an error.
What went wrong
The function that saves a forecast writes one row per fund per signal date. When a row for that fund and date already existed, the insert was set to do nothing. The code was Claude’s, and the commit message that fixed it, translated from Norwegian, describes the result plainly:
“The first save that day won, and all later runs did nothing.”
That day the first run came before we switched the forecast’s underlying data over to the signal matrix. Later runs used the new substrate and produced different numbers, and the page showed those. But the database still held the first run’s row, and the later saves bounced off it without a word.
The commit message spells out what that would have meant:
“So we would have been judged on a number we no longer stood behind, while showing another. For a module whose only purpose is to measure its own predictions, that is destructive — and it would not have failed in any way.”
The last part matters most. Nothing would have shown the fault. When the forecast matured, the app would have scored the +0.633 forecast against the real outcome, logged a hit or a miss, and moved on. The scorecard would have been about a prediction nobody saw.
The first nightly run
The nightly job ran for the first time that evening. According to the commit, the matrix was rebuilt, the outcome count for the matrix went from 40 to 44, and the aggregate on the page moved from +0.233 to +0.244 on the evening’s fresh prices. The fund part of the job, though, changed nothing in storage. The commit records a measurement of the stored row: +0.633 and 35.9 % against the page’s +0.233 and 67.2 %.
There was a second, smaller mistake on the way. Claude had set up a watch to confirm the nightly job ran. The commit notes, translated:
“It polled
lastRunAtin ops status, which is not filled in for these jobs — so it never fired. That the job RAN was confirmed by the effect in the data (40 -> 44 outcomes), not by the status field.”
So the check meant to confirm the run never went off, and the proof that the job ran came from the data changing. Both mistakes have the same shape: a quiet no-op that looks like success unless you compare against something else.
The fix, and why it has a limit
The obvious fix would be to always overwrite the row with the latest calculation. That is also wrong, just in a different way.
The fix Claude made separates two cases. A new calculation on the same day, before the forecast has matured, is treated as a correction. In the commit’s words, the holdings and the matrix are the same, “just calculated more correctly.” So the row is updated.
Once a forecast has matured, the outcome is known. Changing the prediction after that would mean, as the commit puts it, “moving the goalpost after the shot.” So the update only applies while the row’s matured timestamp is still empty. The commit sums it up: that one condition “is the whole difference between a correction and a forgery.”
After the fix
All six funds were recalculated, and according to the commit, the stored rows now match what the page shows.
What we take from it
The bug came from a reasonable instinct: don’t let later runs overwrite what’s already in the log. For an append-only record of observations, that’s right. But a forecast that hasn’t matured yet isn’t a finished observation. It’s still being calculated, and the first draft of the day has no special claim to being the real one.
What protects the log is the moment of maturity, not who got there first. Before it, the latest calculation is the best statement of what we predict. After it, nothing may change.
The rule we took from it: update a stored forecast only while it has not matured. Once the answer is known, the prediction is frozen, because changing it then would move the goalpost. And a second, smaller one: confirm a job ran by its effect in the data, not by a status field you haven’t checked is actually filled in.