What broke
The keep-score read another recipe's log in 29% of cases
The stock app's main portfolio decided which holdings to keep by reading a ranking log that every portfolio in the same mode shared. Between 15 October and 13 November, 29% of its keep-scores came from the default recipe. The fix gives each recipe its own key in the log and its own memory in replay, and adds a watchdog that checks each key has fresh rows.
The short version
What went wrongLIVE's keep-scores were read from a ranking log keyed only by mode, so 29% of them came from the default recipe instead of LIVE's own, and nothing showed it.
How we found itA review compared each keep-score with its source and found 1,886 of 6,483 scores came from the default recipe's log, averaging 0.913 against LIVE's own 0.857.
The rule nowWhen something becomes a variant, key every log and memory on the variant, and give each reader a watchdog that checks its own key has fresh rows.
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 runs one main portfolio and a fleet of paper portfolios that test variations of it. On 15 November 2026 Henning asked for a review. In his words, the focus was that the app should beat the market. He gave Claude full autonomy on one condition: no history would be deleted. During that review, Claude found that the main portfolio had been keeping some holdings because a different strategy liked them.
The other strategy was not doing anything special. The main portfolio was reading the wrong row in a shared log, and nothing in the system showed it.
What the keep-score is for
Every cycle, the app scores what it already holds as well as what it could buy. An earlier review on 19 September found that the rotation was selling holdings that had simply stopped triggering. A held paper got a score of 0, and that accounted for 49% of the swaps. That was not the same as selling bad holdings.
The fix for that problem was a memory. In “decay” mode, a holding gets the higher of today’s score and the best score it was logged with over the last 30 days, scaled down linearly with that score’s age, so a purchase has time to work before the app gives up on it. The scores come from a ranking log that a morning job writes.
Where it went wrong
The ranking log had three keys, one per ranking mode: max, matrix and ml. The matrix key was written once each morning, using the default matrix recipe.
That was fine while every portfolio in matrix mode used the same recipe. It stopped being fine once portfolios got their own sets of sources. The main portfolio ran its own recipe but was still in matrix mode, so its keep-scores were read from the matrix key. That key held the default recipe’s scores, and the default recipe includes momentum.
The change log written for Henning puts the effect in one sentence: the main portfolio held on to some papers because another strategy liked them.
How big it was
The measurement compared each keep-score with where it came from. From 15 October to 13 November, 1,886 of the main portfolio’s 6,483 keep-scores (29%) came from the default recipe’s log rather than the portfolio’s own ranking. Those borrowed scores averaged 0.913. The portfolio’s own scores averaged 0.857. The borrowed scores were higher on average, so they could hold a paper in place that the portfolio’s own recipe would have let go.
The replay had the same problem. It is the tool we use to test configurations against history, and it read the same log. Any earlier replay that tested “decaying score on this recipe” was really testing the contaminated mechanism.
Why nothing caught it
The bug log entry for this case puts it plainly: nothing failed. The key was called “matrix”, the portfolio was in matrix mode, and the number was between 0 and 1. Every check that existed would pass.
The bug log names the class like this: a log keyed on a property that was unique when the log was created (the mode), and that later gained sub-variants (the recipe). It files the case alongside two earlier ones: “the variant cannot differ” and “one definition in many copies”. This one is the reverse of the second: one storage for many definitions.
During the same review, Claude found a smaller bug of the same kind. The tool that creates a new paper variant turned a recipe list with a single source into a plain string. The ranking code expects a list, so that portfolio would have run the default matrix without any warning.
The fix
The code, commit and docs come from Claude.
- One key per recipe. One function builds the ranking key from a portfolio’s config. A non-default recipe gets its own key under
matrix:. A unit test covers the function. - Log every recipe in use. The morning job logs a ranking for each recipe that an active portfolio uses. The list comes from the portfolios themselves, so nobody has to maintain it by hand.
- Both trading paths and the replay read their own key. In replay, a recipe’s memory is the scores already in the log under its key, plus the scores the replay computes day by day. Those are the rows the morning job would have logged.
- No history touched. A database migration only widened the key column. The old
max,matrixandmlkeys and all their rows stayed as they were.
The single-source list bug got its own fix: a recipe given as one source is now always stored as a list.
The deploy ran the same afternoon. No exchange was open, it was a Sunday. A full backup was taken first. Afterwards the log showed separate keys with their own rows: 204 for a new recipe, 270 for the main portfolio’s previous recipe (which now runs in a paper portfolio), and 218 for a calibrated-weights recipe. The old keys were untouched. The commit notes record 1,454 tests passing.
The watchdog
A second change the same afternoon extended an existing status check. Before, it confirmed that each ranking mode in use had recent rows. Now it checks every recipe that an active portfolio uses, under that recipe’s own key.
The code comment explains why this matters. If the log for a recipe is missing, the keep-score quietly falls back to today’s ranking, which looks exactly like a dead mode. So a missing key is the warning sign. The check counts a recipe’s age from the portfolio’s start or its last config change, whichever is later. That way a recipe set on a weekend is not reported dead before its first morning job. Portfolios younger than 48 hours were already exempt.
What it changes in practice
The main portfolio switched to a different recipe on the same day. That makes the per-recipe memory matter right away. Under the old key, the portfolio would have kept reading the default recipe’s scores, never the new one’s. The change log tells Henning to expect the portfolio to swap out papers that no longer fit its own strategy.
We cannot say how much the borrowed scores cost in returns. The material measures how often they were used and how much higher they were on average. It does not measure how the main portfolio would have performed without them, and older replays cannot answer that either, because they used the same contaminated log.
The rule
When something becomes a variant of a thing that used to be unique, every log, cache and memory keyed on the old thing has to be keyed on the variant. Then each reader gets a watchdog that checks its own key has fresh rows, because a fallback that keeps working silently is how this bug stayed hidden.