FA-97208 / Recipe scaling and nutrition / Member archive
Recipe cost per serving: trim yield direction · case 03
100 g of trimmed onion at 80% yield is costed as 80 g purchased.
Case contract
Rows [name, ep_qty, pack_price_cents, pack_size, yield_pct, mode]. Edible portion needs as-purchased ap = ep/(yield/100). mode "whole" buys ceil(ap/pack_size) packs at full price; "bulk" pays ap/pack_size*price. total_cents = half-up integer of the exact total; per_serving_cents = ceiling of exact total/servings; packs lists whole-pack counts by name.
Why this case matters
Menu costing converts trimmed edible quantities to purchase quantities and rounds purchases to packs.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| bulk herbs | {"packs": {}, "per_serving_cents": 34, "total_cents": 101} | {"packs": {}, "per_serving_cents": 60, "total_cents": 180} | Failed |
MEMBER ARCHIVE
The complete case is available to members.
This record includes three runnable implementations, regression fixtures, execution results, and source hashes.
Member access is invitation-based. Sign in with your invited account to inspect the sources.
Sign in to the archive ↗