FAILURE MAP
← Case archive

FA-97247 / Recipe scaling and nutrition / Member archive

Sub-recipe allergen roll-up: contains precedence · case 02

Milk appears both as contains and as may contain.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

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 fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: contains precedence{"contains": ["egg", "peanut", "sesame", "wheat"], "error": null, "may_contain": ["egg", "milk", "tree nut", "wheat"]}{"contains": ["egg", "peanut", "sesame", "wheat"], "error": null, "may_contain": ["milk", "tree nut"]}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 ↗