fix_recipe
Deterministically repair a candidate recipe against a Guardian master.
Verifies the candidate, applies every machine-actionable correction the symbolic engine produced (missing ingredients, quantities, temperatures, durations, cooking media, ingredient substitutions), then re-verifies the result. No LLM is used — the repair is a deterministic function of the candidate recipe and the master ruleset.
Findings that need recipe-authoring judgement — adding a whole cooking
phase, rewriting step instructions, ingredient-ratio rebalancing — are not
auto-applied; they are returned under patches_skipped. Allergen findings
are never auto-fixed. The response reports the verdict before and after so
the caller can see exactly what was resolved.
Note: verdict_after may still be FAILED when structural changes (e.g.
adding a cooking step, rebalancing ingredient ratios) are needed. These
require recipe-authoring judgement and are returned under patches_skipped.
Callers should NOT assume a fixed recipe will pass verification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dish | No | Alias for dish_name — for backward compatibility with production clients. | |
| dish_name | No | Name of the dish to repair against (e.g. 'carbonara', 'rendang', 'roast-chicken'). Use list_dishes() to see all available recipes and their aliases. | |
| master_json | No | Optional user-supplied master SOP to repair against (BYO master, ADR-018), same schema as catalog masters. When provided, the catalog is bypassed and dish_name may be omitted; patches (including suggested_step templates) are built from THIS spec. | |
| candidate_json | No | The full candidate recipe as a JSON string or object — same schema as verify_recipe's candidate_json (title, cuisine, ingredients[], steps[]). | |
| original_prompt | No | Optional. The user's original cooking request, used only for safety-context awareness during verification. Does not change which fixes are applied. | |
| response_format | No | Response format: 'json' (default — includes the full fixed_recipe object) or 'text' (human-readable report). | json |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |