Fix effect loading from IPFS and improve COMPOUND handling

- Remove effect:identity shortcut executor so effects load from IPFS by CID
- COMPOUND nodes now fall back to generic EFFECT executor for dynamic effects
- EFFECT nodes also fall back to generic executor when specific not found
- Update test assertions to match current implementation
- Raise error instead of silently skipping when effect executor not found

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
gilesb
2026-01-13 03:04:52 +00:00
parent ad15ef1ce7
commit c3d6427883
2 changed files with 32 additions and 31 deletions

View File

@@ -29,13 +29,13 @@ class TestRecipeListingFlow:
assert 'cids.append(entry.node_id)' in content, \
"list_by_type should append entry.node_id (IPFS CID) to results"
def test_recipe_service_uses_cache_list_by_type(self) -> None:
"""Recipe service should use cache.list_by_type('recipe')."""
def test_recipe_service_uses_database_items(self) -> None:
"""Recipe service should use database.get_user_items for listing."""
path = Path('/home/giles/art/art-celery/app/services/recipe_service.py')
content = path.read_text()
assert "list_by_type('recipe')" in content, \
"Recipe service should call list_by_type with 'recipe'"
assert 'get_user_items' in content, \
"Recipe service should use database.get_user_items for listing"
def test_recipe_upload_uses_recipe_node_type(self) -> None:
"""Recipe upload should store with node_type='recipe'."""
@@ -71,23 +71,23 @@ class TestRecipeListingFlow:
class TestRecipeFilterLogic:
"""Tests for recipe filtering logic."""
"""Tests for recipe filtering logic via database."""
def test_filter_allows_none_owner(self) -> None:
"""Recipes with owner=None should be visible."""
def test_recipes_filtered_by_actor_id(self) -> None:
"""list_recipes should filter by actor_id parameter."""
path = Path('/home/giles/art/art-celery/app/services/recipe_service.py')
content = path.read_text()
assert 'owner is None' in content, \
"Recipe filter should allow owner=None recipes"
assert 'actor_id' in content, \
"list_recipes should accept actor_id parameter"
def test_filter_allows_matching_owner(self) -> None:
"""Recipes with matching owner should be visible."""
def test_recipes_uses_item_type_filter(self) -> None:
"""list_recipes should filter by item_type='recipe'."""
path = Path('/home/giles/art/art-celery/app/services/recipe_service.py')
content = path.read_text()
assert 'owner == actor_id' in content, \
"Recipe filter should allow recipes where owner matches actor_id"
assert 'item_type="recipe"' in content, \
"Recipe listing should filter by item_type='recipe'"
class TestCacheEntryHasCid:
@@ -102,14 +102,14 @@ class TestCacheEntryHasCid:
assert 'cid' in fields, \
"CacheEntry should have cid field"
def test_artdag_cache_put_sets_cid(self) -> None:
"""artdag Cache.put should set cid on entry."""
def test_artdag_cache_put_computes_cid(self) -> None:
"""artdag Cache.put should compute and store cid in metadata."""
from artdag import Cache
import inspect
source = inspect.getsource(Cache.put)
assert 'cid=' in source, \
"Cache.put should set cid on entry"
assert '"cid":' in source or "'cid':" in source, \
"Cache.put should store cid in metadata"
class TestListByTypeReturnsEntries: