Work / AskCal / Wiki / Concepts
grams-are-the-record
Conceptverified 2026-10-30
Grams are the quantity of record
A Measure is only how a quantity is spoken. A component may carry a unit a
person would say out loud (two eggs, a glass of juice), but grams is what
macros scale from and what a day's total is built on.
lib/measure.ts holds the one invariant, grams === gramsFor(measure), and
lib/scan-mapping.ts DROPS a measure that breaks it rather than repairing one.
Two quantities that can disagree is the stored-total bug one level down.
Three units: g, ml, piece
cup, tbsp and tsp were removed. They bought a six-tab control and a
conversion table for a sentence nobody says about a plate of food.
The server's normaliseMeasure drops an unrecognised unit and keeps the grams
before validation, so a stray unit costs a stepper rather than the whole scan.