{ "executedOn": "2026-11-11", "input": { "people": 2, "budgetCents": 16000, "priceBasis": "Fictional user-supplied prices; not current market quotes", "pantry": { "rice_g": 300, "cooked_chickpeas_g": 400, "eggs_count": 2, "yogurt_g": 200 }, "meals": [ { "id": "M1", "ingredients": { "rice_g": 200, "cooked_chickpeas_g": 400, "tomatoes_g": 200 } }, { "id": "M2", "ingredients": { "eggs_count": 4, "tomatoes_g": 400 } }, { "id": "M3", "ingredients": { "dry_lentils_g": 200, "yogurt_g": 200 } } ], "packs": { "tomatoes_g": { "quantity": 1000, "priceCents": 5000 }, "eggs_count": { "quantity": 6, "priceCents": 6000 }, "dry_lentils_g": { "quantity": 500, "priceCents": 4500 } }, "excludedPantry": "Water, salt and oil already available; quantities and replacement costs not included. No other ingredient assumed." }, "calculation": { "rows": [ { "ingredient": "cooked_chickpeas_g", "required": 400, "stock": 400, "missing": 0, "packs": 0, "purchased": 0, "leftover": 0, "costCents": 0 }, { "ingredient": "dry_lentils_g", "required": 200, "stock": 0, "missing": 200, "packs": 1, "purchased": 500, "leftover": 300, "costCents": 4500 }, { "ingredient": "eggs_count", "required": 4, "stock": 2, "missing": 2, "packs": 1, "purchased": 6, "leftover": 4, "costCents": 6000 }, { "ingredient": "rice_g", "required": 200, "stock": 300, "missing": 0, "packs": 0, "purchased": 0, "leftover": 100, "costCents": 0 }, { "ingredient": "tomatoes_g", "required": 600, "stock": 0, "missing": 600, "packs": 1, "purchased": 1000, "leftover": 400, "costCents": 5000 }, { "ingredient": "yogurt_g", "required": 200, "stock": 200, "missing": 0, "packs": 0, "purchased": 0, "leftover": 0, "costCents": 0 } ], "totalCents": 15500, "budgetCents": 16000, "remainingCents": 500, "withinBudget": true }, "output": { "tr": "Üç akşamlık taslak (her biri 2 kişi):\nM1 — Nohutlu domatesli pilav.\nM2 — Menemen.\nM3 — Mercimek çorbası ve yoğurt.\n\nOrtak ihtiyaç: 600 g domates. Evdeki 2 yumurta düşülünce 2 yumurta eksik. Kuru mercimek eksiği 200 g. Pirinç, pişmiş nohut ve yoğurt satın alınmayacak.\n\nAlınacak tam paketler:\nDomates: 1 × 1 kg = 50 TL.\nYumurta: 1 × 6 adet = 60 TL.\nKuru mercimek: 1 × 500 g = 45 TL.\nSepet toplamı: 155 TL. Bütçe: 160 TL. Kalan: 5 TL.\n\nPlan sonrası elde kalan: 100 g pirinç, 400 g domates, 4 yumurta, 300 g kuru mercimek. Pişmiş nohut ve yoğurt: 0 g.", "en": "Three-dinner draft (2 people each):\nM1 — Chickpea and tomato rice.\nM2 — Eggs with tomatoes.\nM3 — Lentil soup with yogurt.\n\nCombined need: 600 g tomatoes. Deducting 2 pantry eggs leaves a shortage of 2 eggs. Dry lentil shortage: 200 g. No rice, cooked chickpeas or yogurt needs purchasing.\n\nWhole packages to buy:\nTomatoes: 1 × 1 kg = TRY 50.\nEggs: 1 × 6 eggs = TRY 60.\nDry lentils: 1 × 500 g = TRY 45.\nBasket total: TRY 155. Budget: TRY 160. Remaining: TRY 5.\n\nAfter the plan: 100 g rice, 400 g tomatoes, 4 eggs and 300 g dry lentils remain. Cooked chickpeas and yogurt: 0 g." }, "checks": "PASS: aggregate demand, pantry deduction, package rounding, leftovers, exact/insufficient budget and missing-price failure", "code": "\"\"\"Original deterministic shopping arithmetic; no network or external agent code.\"\"\"\nfrom collections import Counter\n\ndef calculate(data):\n required=Counter()\n for meal in data['meals']:\n required.update(meal['ingredients'])\n rows=[]\n for key,amount in sorted(required.items()):\n stock=data['pantry'].get(key,0)\n missing=max(0,amount-stock)\n pack=data['packs'].get(key)\n if missing and not pack:raise ValueError('Missing package price: '+key)\n packs=(missing+pack['quantity']-1)//pack['quantity'] if missing else 0\n bought=packs*pack['quantity'] if packs else 0\n rows.append({'ingredient':key,'required':amount,'stock':stock,'missing':missing,'packs':packs,'purchased':bought,'leftover':stock+bought-amount,'costCents':packs*pack['priceCents'] if packs else 0})\n total=sum(row['costCents'] for row in rows)\n return {'rows':rows,'totalCents':total,'budgetCents':data['budgetCents'],'remainingCents':data['budgetCents']-total,'withinBudget':total<=data['budgetCents']}\n", "execution": "Original AI menu draft followed by actual local Python arithmetic on supplied fictional prices. No external bot, marketplace, purchase, nutrition model or paid API." }