Fail recipe if no output produced, add tests

- execute_recipe now returns success=False if output_cid is None
- Add TestRecipeOutputRequired tests to catch missing output
- Recipe must produce valid output to be considered successful

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-13 01:55:23 +00:00
parent e1c0ebc0a2
commit bfe96a431c
2 changed files with 72 additions and 0 deletions

View File

@@ -905,6 +905,21 @@ def execute_recipe(self, recipe_sexp: str, input_hashes: Dict[str, str], run_id:
output_ipfs_cid = output_result.get("ipfs_cid")
output_path = output_result.get("path")
# Fail if no output was produced
if not output_cid:
logger.error(f"Recipe produced no output! output_step={plan.output_step_id}, result={output_result if output_step else 'no output step'}")
return {
"success": False,
"run_id": run_id,
"error": "Recipe produced no output",
"plan_cid": plan_cid,
"plan_sexp": plan_sexp,
"step_results": step_results,
"total_steps": len(plan.steps),
"cached": total_cached,
"executed": total_executed,
}
# ============ Phase 6: Store Results ============
logger.info("Phase 5: Storing results...")