vibeapp.win

How it works

The promotion gate rolled back on a flat measurement

On 25 October the stock app's promotion gate switched a value+insight+ML recipe off LIVE because the recipe missed the +1 pp admission bar, even though it was level with what replaced it. Rollback now needs a window below −0.5 pp in both of the two latest batches, which gives the gate hysteresis.

The short version

What went wrongThe gate rolled back a recipe on 25 October because it missed the +1 pp admission bar, though it was level with or slightly ahead of the standard matrix. Entry and exit used the same bar.

How we found itHenning asked on 31 October how the week had gone and asked for a review of the logic. The review found the rollback, which nothing in the docs had recorded.

The rule nowRollback now needs a window below −0.5 pp in both of the two latest batches, which gives the gate hysteresis. Every status sweep also reads the configuration change log for LIVE.

This post documents something Claude got wrong. The claim rests on a commit or a file, not on memory. All of Claude's mistakes

Each Sunday a gate in the stock app replays recent market history. It decides whether a strategy setting, which we call a dial, gets switched on or off for LIVE, the setup that mirrors real trades. On 25 October at 05:35 the gate switched off a recipe that combined value, insight and ML signals, and put LIVE back on the standard matrix. The measurement behind that decision was flat. Nobody noticed for six days.

This post covers how the gate works, why a flat result was enough to trigger a rollback, and the fix we made on 31 October: hysteresis, so the gate has a different bar for turning something on than for turning it off.

How the gate decides

Each batch replays a dial over two time windows (A and B). The gate compares the result with the control and records the difference in percentage points (pp). That difference is net after fees. The fee model is modelled brokerage, roughly twice what the broker actually charges, so the gate already counts friction on the pessimistic side.

The rules, as documented in the repository:

  • Promote: a dial marked as promotable gets switched on for LIVE if it passes its requirement in two batches. For an improvement, the requirement is at least +1 pp in both windows.
  • Independent batches: for promotion, the two batches must have disjoint windows. Since 8 October their end dates have to be at least 21 days apart. For rollback, the two latest batches only need end dates at least five days apart.
  • Limits: at most one action per run, so one per week. Rollback goes before promotion. The gate only touches dials it set itself. A dial set by hand is never rolled back by the gate, and a test checks that. Every action goes into the configuration change log and triggers a push notification.
  • Roll back: a dial the gate put on LIVE gets set back to its previous value if it fails in both of the two latest batches.

The flaw sat in that last rule. “Fails” meant failing the same +1 pp admission bar that the dial had to clear to get in.

What happened on 25 October

The gate promoted the value+insight+ML recipe to LIVE on 4 October. Two Sundays later the numbers looked like this:

Batch Window A Window B
18 October +2.68 pp +0.65 pp
25 October +2.63 pp −0.11 pp

Window B was below +1 pp both times, so the dial failed the admission bar in two batches in a row. The rule fired and the recipe came off LIVE.

Compared with the standard matrix LIVE went back to, the recipe was level, not worse. Against the control, its average across the four windows was +1.46 pp, and three of the four windows were positive. The gate rolled back a setting that was level with what replaced it, because the bar for staying was the same as the bar for getting in.

The push notification went out. A working session on 25 October at 07:36, two hours later, did not pick it up. There were no commits from 26 to 30 October, and the app ran on its own. On 31 October Henning asked how the week had gone, then asked us to go over the logic. During that review we found the rollback, which nothing in the docs had recorded.

Hysteresis, in plain terms

A thermostat that switches the heating on below 20 degrees and off above 20 degrees will click on and off all day while the room hovers around 20. A sensible thermostat turns on at 19 and off at 21. The gap between the two thresholds is called hysteresis, and it stops the switch from reacting to noise.

The old gate had no gap. A dial that scored around +1 pp in one window could pass one month and fail the next without anything real changing, and the gate would flip LIVE back and forth. The repository notes one more cost: each flip resets one of the gate’s other requirements (labelled requirement C) to zero, so a dial that flips never builds up the history that requirement needs.

The fix and where the thresholds sit

Since 31 October, rollback requires the dial to be measurably worse: at least one window below −0.5 pp, in both of the two latest batches. The promotion requirement did not change.

That gives the gate two thresholds:

  • On: at least +1 pp in both windows, in two independent batches.
  • Off: worse than −0.5 pp in at least one window, in both of the two latest batches.

Between +1 and −0.5 there is a 1.5 pp band where the gate does nothing. A dial that got in stays in while its results sit in that band.

The −0.5 pp figure was not invented for this fix. The gate already used it to mean “not worse”: it is the bar for a correction, where a fix to a data source only has to come out at −0.5 pp or better in both windows. Rollback now uses the same definition. A promoted dial comes off only when it fails the gate’s own test for “no worse than before”, not when it merely falls short of the bar for “clearly better”.

Requiring this in both batches is a deliberate choice. One bad week is not enough.

Claude added two test cases, both labelled HYSTERESE:

  • The real 25 October numbers (+2.68 / +0.65, then +2.63 / −0.11). The dial now stays.
  • A dial that dips below −0.5 pp in one batch (+2 / −0.6) but not in the other (+0.2 / −0.4). No rollback.

What we did not change

LIVE still runs the standard matrix. The fix changes how the gate behaves from now on. It does not undo the 25 October decision. Whether the value+insight+ML recipe goes back on LIVE is Henning’s call. Claude prepared the configuration command and ran it in dry-run mode only.

The two lessons

The first is about the rule. The admission bar of +1 pp in both windows is meant to keep out changes that might just be luck. Reusing that bar to throw out a dial that is already running punishes ordinary variation. The bar for getting in and the bar for getting thrown out answer different questions, so they now have different thresholds.

The second is about attention. The gate changes LIVE on its own, with no session involved, and in this case the push alone was not enough. The lesson we wrote down in the progress log: read the configuration change log for LIVE on every status sweep, because a push from the gate is a change to LIVE made without a session.

Claude also fixed two other things in the same review: a cash-balance gap with the broker that turned out to be currency conversion, and a paper fill priced above the day’s high. Each needs its own post.