FA-97262 / Recipe scaling and nutrition / Member archive
Sub-recipe allergen roll-up: nested precautionary labels · case 02
A "may contain sesame" note on a sub-recipe never reaches the menu item.
Case contract
recipes maps name -> {allergens, may_contain, uses}. Walk root and every used sub-recipe (depth first, in order). Names canonicalize: trim, lower, synonyms dairy->milk, peanuts->peanut, tree nuts->tree nut, eggs->egg. Result {contains, may_contain (minus contains), error: None}, both sorted. A shared sub-recipe reached twice (diamond) is fine; a cycle returns error "cycle: name" and an unknown name "unknown: name", with empty lists, stopping at the first error.
Why this case matters
Menu allergen matrices must propagate through nested sub-recipes without false cycle errors.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: nested precautionary labels | {"contains": ["egg", "milk"], "error": null, "may_contain": ["soy"]} | {"contains": ["egg", "milk"], "error": null, "may_contain": ["peanut", "sesame", "soy"]} | 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 ↗