FA-97135 / Recipe scaling and nutrition / Member archive
Shopping list aggregator: double-s guard · case 05
Watercress is listed as "watercres".
Case contract
Rows [name, qty, unit]. Names normalize: trim, lower, "-oes" -> drop "es", "-ies" -> "y", other trailing "s" dropped unless "ss". Volume (tsp=1, tbsp=3, cup=48 tsp), mass (g, kg=1000 g) and other units aggregate separately per name. Pantry {name: [qty, unit]} subtracts from the same name and dimension, never below 0. Output sorted by (name, dimension) as [name, str(qty), unit], skipping zero totals; volume shows cup if >=12 tsp, else tbsp if >=3 tsp, else tsp; mass shows kg if >=1000 g.
Why this case matters
Meal planners merge ingredient lists across recipes and subtract what is already in the pantry.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: double-s guard | [["egg", "2", "each"], ["egg", "1", "kg"], ["potato", "3/4", "tsp"], ["watercres", "1/2", "each"]] | [["egg", "2", "each"], ["egg", "1", "kg"], ["potato", "3/4", "tsp"], ["watercress", "1/2", "each"]] | 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 ↗