Rename content_hash/output_hash to cid throughout

Refactor to use IPFS CID as the primary content identifier:
- Update database schema: content_hash -> cid, output_hash -> output_cid
- Update all services, routers, and tasks to use cid terminology
- Update HTML templates to display CID instead of hash
- Update cache_manager parameter names
- Update README documentation

This completes the transition to CID-only content addressing.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-12 08:02:44 +00:00
parent 494a2a8650
commit 92d26b2b72
22 changed files with 981 additions and 988 deletions

View File

@@ -350,7 +350,7 @@ async def run_recipe(
if node.get("type") == "SOURCE" and "asset" in config:
asset_name = config["asset"]
if asset_name in assets:
config["content_hash"] = assets[asset_name].get("hash")
config["cid"] = assets[asset_name].get("hash")
# Resolve effect references for EFFECT nodes
if node.get("type") == "EFFECT" and "effect" in config:
@@ -392,21 +392,21 @@ async def run_recipe(
input_name_to_node[node["name"].replace("-", "_")] = node_id
# Map user-provided input names to content hashes (for variable inputs)
for input_name, content_hash in req.inputs.items():
for input_name, cid in req.inputs.items():
# Try direct node ID match first
if input_name in nodes:
node = nodes[input_name]
if node.get("node_type") == "SOURCE":
if "config" not in node:
node["config"] = {}
node["config"]["content_hash"] = content_hash
node["config"]["cid"] = cid
# Try input name lookup
elif input_name in input_name_to_node:
node_id = input_name_to_node[input_name]
node = nodes[node_id]
if "config" not in node:
node["config"] = {}
node["config"]["content_hash"] = content_hash
node["config"]["cid"] = cid
# Transform output to output_id
if "output" in dag_copy:
@@ -527,7 +527,7 @@ async def publish_recipe(
# Use cache service to publish (recipes are stored in cache)
cache_service = CacheService(database, get_cache_manager())
ipfs_cid, error = await cache_service.publish_to_l2(
content_hash=recipe_id,
cid=recipe_id,
actor_id=ctx.actor_id,
l2_server=ctx.l2_server,
auth_token=request.cookies.get("auth_token"),