You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Shopping list scales a referenced recipe with servings: 0 by infinity #699
A referenced recipe with servings: 0 (or yield: 0) is scaled by infinity; the shopping list prints tomatoes inf with no warning.
Where
crates/core/src/shopping_list/mod.rs:1007-1026,1228-1251 — target_factor declines a zero base, then falls through to cooklang's scale_to_target, which computes target/0 = inf and returns Ok.
Repro
sauce0.cook:
---
servings: 0
---
Simmer @tomatoes{4}.
main0.cook:
Prepare @./sauce0{6%servings}.
$ cook shopping-list main0.cook
tomatoes inf
(JSON output: "value": null), exit 0, no warning — despite the UnscalableReference machinery existing for exactly this.
Expected
An unscalable-reference warning (or error); never inf.
Actual
tomatoes inf, exit 0, silent.
Acceptance criteria (red → green)
Red: the repro prints tomatoes inf with exit 0 and no warning.
Green: the repro warns that the reference cannot be scaled (the existing UnscalableReference path) and lists the ingredient unscaled or omits it explicitly.
Activity