FA-97218 / Recipe scaling and nutrition / Member archive
Recipe cost per serving: bulk proportional price · case 03
Buying 30 g of bulk herbs costs the price of 30 packs.
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": 6000, "total_cents": 18000} | {"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 ↗