Fix registry lookups to use cid, remove dead legacy code

- Fix all registry lookups to use "cid" instead of "hash" key
  - app/routers/recipes.py: asset and effect resolution
  - tasks/execute_sexp.py: effect config lookups
  - server_legacy.py references (now deleted)
- Prefer IPFS CID over local hash in cache operations
  - cache_service.py: import_from_ipfs, upload_content
  - orchestrate.py: plan caching
  - legacy_tasks.py: node hash tracking

Remove ~7800 lines of dead code:
- server_legacy.py: replaced by modular app/ structure
- tasks/*_cid.py: unused refactoring only imported by server_legacy

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-12 09:09:40 +00:00
parent 8e7228fc38
commit 60344b34f4
9 changed files with 12 additions and 7783 deletions

View File

@@ -350,13 +350,13 @@ async def run_recipe(
if node.get("type") == "SOURCE" and "asset" in config:
asset_name = config["asset"]
if asset_name in assets:
config["cid"] = assets[asset_name].get("hash")
config["cid"] = assets[asset_name].get("cid")
# Resolve effect references for EFFECT nodes
if node.get("type") == "EFFECT" and "effect" in config:
effect_name = config["effect"]
if effect_name in effects:
config["effect_hash"] = effects[effect_name].get("hash")
config["effect_hash"] = effects[effect_name].get("cid")
# Transform to artdag format: type->node_type, id->node_id
transformed = {

View File

@@ -432,8 +432,8 @@ class CacheService:
return None, f"Could not fetch CID {ipfs_cid} from IPFS"
# Store in cache
cached, _ = self.cache.put(tmp_path, node_type="import", move=True)
cid = cached.cid
cached, ipfs_cid = self.cache.put(tmp_path, node_type="import", move=True)
cid = ipfs_cid or cached.cid # Prefer IPFS CID
# Save to database
await self.db.create_cache_item(cid, ipfs_cid)
@@ -468,7 +468,7 @@ class CacheService:
# Store in cache (also stores in IPFS)
cached, ipfs_cid = self.cache.put(tmp_path, node_type="upload", move=True)
cid = cached.cid
cid = ipfs_cid or cached.cid # Prefer IPFS CID
# Save to database with detected MIME type
await self.db.create_cache_item(cid, ipfs_cid)