FAILURE MAP
← Case archive

FA-97196 / Recipe scaling and nutrition / Open access

Roast timing and carryover planner: cook time rounding · case 01

A 1.2 kg medium-rare roast (42 min) is scheduled for 40 minutes instead of 45.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Cooking time is rounded to the nearest 5 minutes instead of up.

THE FAILURE

Cooking time is rounded to the nearest 5 minutes instead of up.

Unsuccessful approach: Ceiling to whole minutes skips the 5-minute step.

Case contract

Doneness (trimmed, lower) rare 52C/30 min per kg, medium rare 57/35, medium 63/40, well 71/50; unknown -> error; weight <= 0 -> error. Carryover 2C below 1.5 kg, 4C below 3 kg, else 6C. Beef and lamb pull at target - carryover. Poultry ignores doneness: pull at 74 (no carryover credit) and uses the well-done rate. cook_min = ceiling to a multiple of 5 of weight*rate. rest_min = half-up weight*5 clamped to [10, 30].

Why this case matters

Roast planners must account for carryover cooking and food-safety minimums for poultry.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(weight_kg, doneness, cut):
    T = {'rare': 52, 'medium rare': 57, 'medium': 63, 'well': 71}
    PER = {'rare': 30, 'medium rare': 35, 'medium': 40, 'well': 50}
    d = doneness.strip().lower()
    if d not in T:
        return 'error: doneness'
    if weight_kg <= 0:
        return 'error: weight'
    w = Fraction(str(weight_kg))
    carry = 2 if w < Fraction(3, 2) else 4 if w < 3 else 6
    if cut == 'poultry':
        pull = 74
    else:
        pull = T[d] - carry
    per = PER['well'] if cut == 'poultry' else PER[d]
    cook = 5 * math.floor(w * per / 5 + Fraction(1, 2))
    rest = min(30, max(10, math.floor(w * 5 + Fraction(1, 2))))
    return {'pull_c': pull, 'cook_min': cook, 'rest_min': rest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['regression: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['repair check: cook time rounding', [1.5, 'medium rare', 'beef'],
   {'cook_min': 55, 'pull_c': 53, 'rest_min': 10}],
  ['generated control 1', [0, 'medium rare', 'beef'], 'error: weight'],
  ['generated control 2', [2, 'rare', 'lamb'], {'cook_min': 60, 'pull_c': 48, 'rest_min': 10}],
  ['generated control 3', [1.5, 'Medium', 'lamb'], {'cook_min': 60, 'pull_c': 59, 'rest_min': 10}]],
 [['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['regression: cook time rounding', [1.2, 'medium rare', 'beef'],
   {'cook_min': 45, 'pull_c': 55, 'rest_min': 10}],
  ['repair check: cook time rounding', [2.4, 'Medium', 'beef'],
   {'cook_min': 100, 'pull_c': 59, 'rest_min': 12}],
  ['generated control 1', [2, 'blue', 'lamb'], 'error: doneness'],
  ['generated control 2', [3.5, 'Medium', 'beef'], {'cook_min': 140, 'pull_c': 57, 'rest_min': 18}],
  ['generated control 3', [3.5, 'blue', 'beef'], 'error: doneness']],
 [['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['regression: cook time rounding', [4.2, 'medium rare', 'beef'],
   {'cook_min': 150, 'pull_c': 51, 'rest_min': 21}],
  ['repair check: cook time rounding', [1.2, 'medium rare', 'beef'],
   {'cook_min': 45, 'pull_c': 55, 'rest_min': 10}],
  ['generated control 1', [6, 'well', 'poultry'], {'cook_min': 300, 'pull_c': 74, 'rest_min': 30}],
  ['generated control 2', [7, 'rare', 'poultry'], {'cook_min': 350, 'pull_c': 74, 'rest_min': 30}],
  ['generated control 3', [2.4, 'blue', 'poultry'], 'error: doneness']],
 [['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['regression: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['repair check: cook time rounding', [1.2, 'Medium', 'beef'],
   {'cook_min': 50, 'pull_c': 61, 'rest_min': 10}],
  ['generated control 1', [7, 'medium rare', 'lamb'], {'cook_min': 245, 'pull_c': 51, 'rest_min': 30}],
  ['generated control 2', [3, 'Medium', 'beef'], {'cook_min': 120, 'pull_c': 57, 'rest_min': 15}],
  ['generated control 3', [3, 'rare', 'poultry'], {'cook_min': 150, 'pull_c': 74, 'rest_min': 15}]],
 [['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['regression: cook time rounding', [2.4, 'rare', 'lamb'], {'cook_min': 75, 'pull_c': 48, 'rest_min': 12}],
  ['repair check: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['generated control 1', [0.5, 'blue', 'lamb'], 'error: doneness'],
  ['generated control 2', [4.2, 'medium rare', 'poultry'], {'cook_min': 210, 'pull_c': 74, 'rest_min': 21}],
  ['generated control 3', [0, 'medium rare', 'poultry'], 'error: weight']]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
small rare roast{'cook_min': 30, 'pull_c': 50, 'rest_min': 10}{'cook_min': 30, 'pull_c': 50, 'rest_min': 10}Passed
large medium roast{'cook_min': 170, 'pull_c': 57, 'rest_min': 21}{'cook_min': 170, 'pull_c': 57, 'rest_min': 21}Passed
chicken{'cook_min': 100, 'pull_c': 74, 'rest_min': 10}{'cook_min': 100, 'pull_c': 74, 'rest_min': 10}Passed
regression: cook time rounding{'cook_min': 35, 'pull_c': 50, 'rest_min': 10}{'cook_min': 40, 'pull_c': 50, 'rest_min': 10}Failed
repair check: cook time rounding{'cook_min': 55, 'pull_c': 53, 'rest_min': 10}{'cook_min': 55, 'pull_c': 53, 'rest_min': 10}Passed
generated control 1error: weighterror: weightPassed
generated control 2{'cook_min': 60, 'pull_c': 48, 'rest_min': 10}{'cook_min': 60, 'pull_c': 48, 'rest_min': 10}Passed
generated control 3{'cook_min': 60, 'pull_c': 59, 'rest_min': 10}{'cook_min': 60, 'pull_c': 59, 'rest_min': 10}Passed

SHA-256 / 7ac11804401ef59b26ef2f812525ce3a56b5b80228137191f12fbe227d015389

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(weight_kg, doneness, cut):
    T = {'rare': 52, 'medium rare': 57, 'medium': 63, 'well': 71}
    PER = {'rare': 30, 'medium rare': 35, 'medium': 40, 'well': 50}
    d = doneness.strip().lower()
    if d not in T:
        return 'error: doneness'
    if weight_kg <= 0:
        return 'error: weight'
    w = Fraction(str(weight_kg))
    carry = 2 if w < Fraction(3, 2) else 4 if w < 3 else 6
    if cut == 'poultry':
        pull = 74
    else:
        pull = T[d] - carry
    per = PER['well'] if cut == 'poultry' else PER[d]
    cook = math.ceil(w * per)
    rest = min(30, max(10, math.floor(w * 5 + Fraction(1, 2))))
    return {'pull_c': pull, 'cook_min': cook, 'rest_min': rest}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['regression: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['repair check: cook time rounding', [1.5, 'medium rare', 'beef'],
   {'cook_min': 55, 'pull_c': 53, 'rest_min': 10}],
  ['generated control 1', [0, 'medium rare', 'beef'], 'error: weight'],
  ['generated control 2', [2, 'rare', 'lamb'], {'cook_min': 60, 'pull_c': 48, 'rest_min': 10}],
  ['generated control 3', [1.5, 'Medium', 'lamb'], {'cook_min': 60, 'pull_c': 59, 'rest_min': 10}]],
 [['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['regression: cook time rounding', [1.2, 'medium rare', 'beef'],
   {'cook_min': 45, 'pull_c': 55, 'rest_min': 10}],
  ['repair check: cook time rounding', [2.4, 'Medium', 'beef'],
   {'cook_min': 100, 'pull_c': 59, 'rest_min': 12}],
  ['generated control 1', [2, 'blue', 'lamb'], 'error: doneness'],
  ['generated control 2', [3.5, 'Medium', 'beef'], {'cook_min': 140, 'pull_c': 57, 'rest_min': 18}],
  ['generated control 3', [3.5, 'blue', 'beef'], 'error: doneness']],
 [['chicken', [2, 'medium', 'poultry'], {'cook_min': 100, 'pull_c': 74, 'rest_min': 10}],
  ['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['regression: cook time rounding', [4.2, 'medium rare', 'beef'],
   {'cook_min': 150, 'pull_c': 51, 'rest_min': 21}],
  ['repair check: cook time rounding', [1.2, 'medium rare', 'beef'],
   {'cook_min': 45, 'pull_c': 55, 'rest_min': 10}],
  ['generated control 1', [6, 'well', 'poultry'], {'cook_min': 300, 'pull_c': 74, 'rest_min': 30}],
  ['generated control 2', [7, 'rare', 'poultry'], {'cook_min': 350, 'pull_c': 74, 'rest_min': 30}],
  ['generated control 3', [2.4, 'blue', 'poultry'], 'error: doneness']],
 [['bad doneness', [2, 'blue', 'beef'], 'error: doneness'],
  ['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['regression: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['repair check: cook time rounding', [1.2, 'Medium', 'beef'],
   {'cook_min': 50, 'pull_c': 61, 'rest_min': 10}],
  ['generated control 1', [7, 'medium rare', 'lamb'], {'cook_min': 245, 'pull_c': 51, 'rest_min': 30}],
  ['generated control 2', [3, 'Medium', 'beef'], {'cook_min': 120, 'pull_c': 57, 'rest_min': 15}],
  ['generated control 3', [3, 'rare', 'poultry'], {'cook_min': 150, 'pull_c': 74, 'rest_min': 15}]],
 [['zero weight', [0, 'rare', 'beef'], 'error: weight'],
  ['small rare roast', [1, 'rare', 'beef'], {'cook_min': 30, 'pull_c': 50, 'rest_min': 10}],
  ['large medium roast', [4.2, 'medium', 'beef'], {'cook_min': 170, 'pull_c': 57, 'rest_min': 21}],
  ['regression: cook time rounding', [2.4, 'rare', 'lamb'], {'cook_min': 75, 'pull_c': 48, 'rest_min': 12}],
  ['repair check: cook time rounding', [1.2, 'rare', 'lamb'], {'cook_min': 40, 'pull_c': 50, 'rest_min': 10}],
  ['generated control 1', [0.5, 'blue', 'lamb'], 'error: doneness'],
  ['generated control 2', [4.2, 'medium rare', 'poultry'], {'cook_min': 210, 'pull_c': 74, 'rest_min': 21}],
  ['generated control 3', [0, 'medium rare', 'poultry'], 'error: weight']]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
small rare roast{'cook_min': 30, 'pull_c': 50, 'rest_min': 10}{'cook_min': 30, 'pull_c': 50, 'rest_min': 10}Passed
large medium roast{'cook_min': 168, 'pull_c': 57, 'rest_min': 21}{'cook_min': 170, 'pull_c': 57, 'rest_min': 21}Failed
chicken{'cook_min': 100, 'pull_c': 74, 'rest_min': 10}{'cook_min': 100, 'pull_c': 74, 'rest_min': 10}Passed
regression: cook time rounding{'cook_min': 36, 'pull_c': 50, 'rest_min': 10}{'cook_min': 40, 'pull_c': 50, 'rest_min': 10}Failed
repair check: cook time rounding{'cook_min': 53, 'pull_c': 53, 'rest_min': 10}{'cook_min': 55, 'pull_c': 53, 'rest_min': 10}Failed
generated control 1error: weighterror: weightPassed
generated control 2{'cook_min': 60, 'pull_c': 48, 'rest_min': 10}{'cook_min': 60, 'pull_c': 48, 'rest_min': 10}Passed
generated control 3{'cook_min': 60, 'pull_c': 59, 'rest_min': 10}{'cook_min': 60, 'pull_c': 59, 'rest_min': 10}Passed

SHA-256 / da9098341dc0b5723b9d15c752351afc5e52bfb50f8528663abec89060b65e1e

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic toy contract stated in full here; it is a bounded teaching model, not an authoritative reference or standards implementation. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:52:29.781412+00:00.

Case digest / 36bf5f28c79373c5d238a96b19de6632b873d1d5807690051733f3f07416507f