From 3599f3779b6defda8d94f5229f456eafa075bac5 Mon Sep 17 00:00:00 2001 From: gilesb Date: Mon, 12 Jan 2026 00:36:14 +0000 Subject: [PATCH] Add IPFS link to recipe S-expression display - Show ipfs://... link next to recipe S-expression header - Links to ipfs.io gateway for viewing the raw S-expression Co-Authored-By: Claude Opus 4.5 --- app/routers/runs.py | 4 ++++ app/templates/runs/detail.html | 12 ++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/routers/runs.py b/app/routers/runs.py index e437cf1..bf59ee9 100644 --- a/app/routers/runs.py +++ b/app/routers/runs.py @@ -179,6 +179,7 @@ async def get_run( # Try to load the recipe to show the plan plan = None plan_sexp = None # Native S-expression if available + recipe_ipfs_cid = None recipe_id = run.get("recipe") if recipe_id and len(recipe_id) == 64: # Looks like a hash try: @@ -189,6 +190,8 @@ async def get_run( # Use native S-expression if available (code is data!) if recipe.get("sexp"): plan_sexp = recipe["sexp"] + # Get IPFS CID for the recipe + recipe_ipfs_cid = recipe.get("ipfs_cid") # Build steps for DAG visualization dag = recipe.get("dag", {}) @@ -329,6 +332,7 @@ async def get_run( dag_elements=dag_elements, output_media_type=output_media_type, plan_sexp=plan_sexp, + recipe_ipfs_cid=recipe_ipfs_cid, active_tab="runs", ) diff --git a/app/templates/runs/detail.html b/app/templates/runs/detail.html index f0a87ed..ff2ab96 100644 --- a/app/templates/runs/detail.html +++ b/app/templates/runs/detail.html @@ -159,8 +159,16 @@ {% if plan_sexp %}
- - Recipe (S-expression) + + Recipe (S-expression) + {% if recipe_ipfs_cid %} + + ipfs://{{ recipe_ipfs_cid[:16] }}... + + {% endif %}
{{ plan_sexp }}