Cookwala / حزمة التطوير والسيناريوهات / 098
Read a recipe's steps in English and Arabic, exporting nothing
Every example recipe carries its text in two languages under one process graph. List the recipes, read koshari's titles and first step in both, and confirm a second recipe follows the same shape. Nothing is written anywhere; a researcher reads.
اقرأ أولًا: /docs/CORE/ /recipes/
الخطوات
The hub plans nine example recipes, all Egyptian home cooking.
listRecipesKoshari: one id, names and step text in en and ar, the same node ids in both.
getRecipeThe Arabic step for the same node n1.
Shakshuka has the same shape; its id carries the example- prefix.
getRecipe
النتيجة
You can study bilingual recipe text against one machine-readable process graph without touching any household or execution data. Next: 099 validates a recipe as a publisher would.
سطر الأوامر
curl -s ${COOKWALA_HUB:-http://localhost:7878}/v1/tools/recipes/koshari | jq '{en: .text.en.title, ar: .text.ar.title, n1: [.text.en.steps.n1, .text.ar.steps.n1]}'
jq '.text | keys' examples/koshari.cookwala.jsonالمخرجات المسجلة
الحالة: ok
[1] listRecipes: {"recipes": ["basbousa", "ful-medames", "kofta-oven", "koshari", "lentil-soup", "molokhia", "rice-vermicelli", "salata-baladi", "shakshuka"]}
[2] getRecipe: {"$schema": "https://cookwala.ai/v1/schemas/recipe.schema.json", "cookwala": "0.2.0", "id": "example-koshari", "revision": 1, "updated": "2026-10-04", "verification": {"level": "V1", "evidence": {"simulatorRuns": 0, "humanReviews": 1, "fieldReports": 0}, "reviewedBy": "cookwala.ai editorial (structure only)", "notes": "Example recipe written to exercise the standard: structured steps, end conditions, hazards and critical control points. Not simulated and not field-verified; values are typical home-cooking values, not measurements."}, "dish": {"names": {"en": "Koshari", "ar": "كشري"}, "cuisine"…
[4] getRecipe: {"$schema": "https://cookwala.ai/v1/schemas/recipe.schema.json", "cookwala": "0.1.0", "id": "example-shakshuka", "revision": 2, "updated": "2026-10-03", "hash": "sha256:2ea6fab93cc673fc6784f9bc9fe401d2387bb7779dc537df97286b73807c8841", "verification": {"level": "V2", "evidence": {"simulatorRuns": 1, "humanReviews": 1, "fieldReports": 0}, "reviewedBy": "fifi.cooking editorial", "notes": "Illustrative example for the spec; values are realistic but not field-verified."}, "dish": {"names": {"en": "Shakshuka", "ar": "شكشوكة", "fr": "Chakchouka"}, "cuisine": ["TN", "MA", "DZ", "LY"], "course": "main…الكود
التشغيل: python scenarios/out/098-read-recipe-text-in-two-languages/python.py
# Scenario 098: Read a recipe's steps in English and Arabic, exporting nothing
# Every example recipe carries its text in two languages under one process graph. List the recipes, read koshari's titles and first step in both, and confirm a second recipe follows the same shape. Nothing is written anywhere; a researcher reads.
# Run a hub first: python hub/cookwala_hub.py --recipes examples
import json, os
from cookwala.client import CookwalaClient, CookwalaProblem
def load(path):
with open(path, encoding="utf-8") as f:
return json.load(f)
def pick(obj, path):
for part in path.replace("]", "").replace("[", ".").split("."):
obj = obj[int(part)] if part.isdigit() else (len(obj) if part == "length" else obj.get(part))
return obj
c = CookwalaClient(os.environ.get("COOKWALA_HUB", "http://localhost:7878"))
# Step 1: The hub plans nine example recipes, all Egyptian home cooking.
recipes = c.list_recipes()
assert pick(recipes, "recipes.length") == 9, pick(recipes, "recipes.length")
print("ok", "recipes.length", "=", 9)
assert pick(recipes, "recipes[3]") == "koshari", pick(recipes, "recipes[3]")
print("ok", "recipes[3]", "=", "koshari")
# Step 2: Koshari: one id, names and step text in en and ar, the same node ids in both.
k = c.get_recipe("koshari")
assert pick(k, "text.en.title") == "Koshari", pick(k, "text.en.title")
print("ok", "text.en.title", "=", "Koshari")
assert pick(k, "text.ar.title") == "كشري", pick(k, "text.ar.title")
print("ok", "text.ar.title", "=", "كشري")
assert pick(k, "dish.names.en") == "Koshari", pick(k, "dish.names.en")
print("ok", "dish.names.en", "=", "Koshari")
assert pick(k, "dish.cuisine") == ["EG"], pick(k, "dish.cuisine")
print("ok", "dish.cuisine", "=", ["EG"])
assert pick(k, "text.en.steps.n1") == "Bring the lentils and water to the boil.", pick(k, "text.en.steps.n1")
print("ok", "text.en.steps.n1", "=", "Bring the lentils and water to the boil.")
# Step 3: The Arabic step for the same node n1.
assert pick(k, "text.ar.steps.n1") == "اتركي العدس والماء حتى يغليا.", pick(k, "text.ar.steps.n1")
print("ok", "text.ar.steps.n1", "=", "اتركي العدس والماء حتى يغليا.")
# Step 4: Shakshuka has the same shape; its id carries the example- prefix.
s = c.get_recipe("shakshuka")
assert pick(s, "id") == "example-shakshuka", pick(s, "id")
print("ok", "id", "=", "example-shakshuka")
assert pick(s, "text.en.title") == "Shakshuka", pick(s, "text.en.title")
print("ok", "text.en.title", "=", "Shakshuka")
assert pick(s, "text.ar.title") == "شكشوكة", pick(s, "text.ar.title")
print("ok", "text.ar.title", "=", "شكشوكة")
print("scenario complete")