Nutrition 8 min read

Your scale lies for four weeks

How our diet trend evaluator mistook glycogen water for tissue gain, turned a bulk into a deficit, and the two guards we added.

We build gostrong around one rule: a number is only allowed to change your plan if we can defend it. This post is about a time we broke that rule, how we noticed, and what we changed. We think the honest version is more useful than a polished one.

What went wrong

A muscle-gain phase showed a daily calorie goal below the user’s estimated maintenance. A bulk was prescribing a deficit.

We ruled out the usual suspects first: training days, session calories, stored plan snapshots, a stale deploy. None of them was the cause. The cause was a single stored number, the phase’s calorie adjustment, which read -259 kcal/day on a phase that had started at a +241 kcal/day surplus.

The arithmetic is short. In week 3 of a maintenance-to-bulk switch, our trend evaluator saw the scale rising quickly, decided the user was gaining too fast, and applied its largest allowed correction of -500 kcal/day.

start of phase:   +241   (the planned surplus)
week 3 correction: -500   (clamped, "gaining too fast")
stored adjustment: -259   (a bulk that is now a cut)

The scale was not wrong about the number. It was wrong about what the number meant.

Why the scale rose: glycogen and water

When you move from maintenance to a surplus, you usually eat more carbohydrate. Muscle and liver store carbohydrate as glycogen, and each gram of glycogen is stored with roughly 3-4 g of water. That is how a carbohydrate change can move the scale by about 3 kg in a few weeks while adding almost no tissue.

This matters because our energy model converts weight change into calories using a tissue constant (the classic figure of about 3,500 kcal per pound). Water bound to glycogen carries far less energy than that constant assumes. So when the evaluator multiplies a water-driven jump by a tissue-sized factor, it gets a large, confident, wrong answer: “you are gaining much faster than planned, cut intake.”

Early in a phase the scale is mostly measuring fluid shifts. Later it increasingly measures tissue. The trouble is that a naive evaluator cannot tell the two apart.

Why a 14-day slope is too noisy to act on

Our evaluator estimates your real expenditure from intake and the slope of your weight over a window. A slope fitted to noisy data has a standard error, and that error shrinks quickly as the window grows: it falls with the number of readings and with the square of the span.

Assuming a daily scale standard deviation of about 0.7 kg (ordinary water, glycogen and gut variation), the one-sigma error on the resulting estimate is:

Window1 SE on the expenditure estimate
14 days±357 kcal/day
21 days±194 kcal/day
28 days±126 kcal/day
42 days±69 kcal/day

At 14 days the error is larger than the adjustment we are trying to estimate. A short window does not make the system cautious. It makes it confidently wrong. At 28 days the signal starts to be worth reading, and by 42 days it is worth trusting at full weight.

Two caveats from our own notes. These figures are optimistic, because water shifts persist for days and consecutive readings are correlated, so the effective sample is smaller than the calendar count. And the noise assumption is a modelling input, not a measurement of any one person.

The root cause: two thresholds that disagreed

When we read the code, the bug was not one mistake but two.

First, our adjustment function clamped each correction to plus or minus 500 kcal, but it never checked the result against the goal of the phase. A bulk could cross zero and become a deficit, and nothing objected.

Second, our adaptive-expenditure code already required 28 days of logged data before trusting a weight slope, precisely because of glycogen-bound water. But the trend evaluator would act after only two weeks of data. Two parts of the same system held different opinions about when the scale becomes believable, and the more optimistic one was the one that could change your calories.

There was also a timing quirk that made it harder to see. An earlier evaluation had been skipped because the week was marked non-compliant. Regenerating the week’s meals created plan snapshots, which flipped adherence to compliant and let the pending correction through. That is why it looked tied to a training change, and why the first theories were wrong.

Fix one: an objective floor

The first guard is about what the evaluator is allowed to do, regardless of what it measures. A phase has an objective, and a correction may shrink a surplus or deficit but never invert it.

  • Muscle gain: the adjustment is floored at the surplus implied by the minimum sanctioned gain rate, MuscleGainMinRate, which is 0.25% of body weight per week.
  • Fat loss: symmetrically, the adjustment is capped at the deficit implied by FatLossMinRate, 0.5% per week, so a cut can never turn into a surplus.
  • Maintenance: unfloored.

Both floors are computed from the weight the phase started at. That is deliberate. If the floor followed the current scale, a water-inflated reading would move the floor itself, and we would be back to trusting the thing we distrust.

In pseudocode:

delta      = clamp(suggested, -500, +500)
adjustment = adjustment + delta
floor      = surplus at MuscleGainMinRate of start weight
if objective is muscle gain and adjustment < floor:
    adjustment = floor

The evaluator can still neutralise a phase that is genuinely running too fast. It can no longer turn a bulk into a cut.

The rate bands themselves come from the literature, not from us. For lean gain, Garthe 2013 synthesised a recommended 0.25-0.5% of body weight per week, and found excess surplus drove undesirable fat gain, which is why the ceiling is 0.5%. For fat loss, Garthe 2011 compared a 0.7% per week loss group with a 1.4% per week group, and the slower group retained more lean mass and strength. That anchors our fat-loss band at or below 1.0% per week.

Fix two: a 28-day settling gate

The second guard is about when the evaluator is allowed to act. For any phase that is not maintenance, we now apply no calorie change until the phase is at least 28 days old (MinPhaseDaysBeforeAdjustment = 28).

The trend is still evaluated and its status is still recorded during those four weeks, so the status banner keeps working and you can see how the trend looks. Only the mutation waits. This is the same 28-day line the adaptive-expenditure code uses, so the two parts of the system finally agree.

Note how the guards cover each other. The gate keeps early water weight from triggering a correction at all. The floor means that even if a bad correction slips through later, for example one driven by a real overshoot, the phase stays on the right side of zero.

What we did not fix, and what we corrected afterwards

We want to be as clear about the limits as the fix.

  • The per-cycle cap of 500 kcal is unchanged. It limited the damage here, but it is a blunt bound, and we have flagged it as a known gap.
  • Our feature documentation describes a flow where the evaluator surfaces a banner and you accept the change. That accept step is not wired up. Today the correction is applied automatically, which is exactly why the two guards above matter. Restoring an explicit accept step is a separate, open design question, and we would rather say so than imply it exists.
  • For the affected phase we restored the stored adjustment to its original +241 and paused the evaluator briefly while the fix shipped.

What this means for you

If you are starting a bulk or a cut, the first month of scale data is the least informative month you will have. Expect it to rise or fall for reasons that have little to do with tissue. That is normal, and it is the reason gostrong waits before touching your calories in the first four weeks of a phase.

You do not need to do anything to benefit from this. Keep logging your weight and your food. Judge a phase by its trend over several weeks, not by a single week’s number. And if your plan ever contradicts your goal, treat that as a signal worth questioning.

How we think about it

Every automated system that changes your plan should have two checks: a rule about when it may act, and a rule about what it may never do. We had neither in the right place, and a bulk briefly became a cut. We added both, wrote down why, and documented what is still open.

gostrong does this for you: it estimates, waits until the data is believable, and keeps your plan pointed at the goal you chose. If that approach appeals, have a look at gostrong.

References

  • Garthe I, et al. (2013). Effect of nutritional intervention on body composition and performance in elite athletes. Eur J Sport Sci 13(3):295-303. https://pubmed.ncbi.nlm.nih.gov/23679146/
  • Garthe I, et al. (2011). Effect of two different weight-loss rates on body composition and strength and power-related performance in elite athletes. Int J Sport Nutr Exerc Metab 21(2):97-104. https://pubmed.ncbi.nlm.nih.gov/21558571/