From 90a367089dc9d7baaf08214285566159bce15bb8 Mon Sep 17 00:00:00 2001 From: Agent Zero Date: Sun, 23 Aug 2026 15:45:43 +0200 Subject: [PATCH] fix(arch-038,arch-054): register_event_handlers hook in BasePlugin; entity model lookup matches registry shape --- app/plugins/base.py | 9 +++++++++ app/routes/entity_permissions.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/plugins/base.py b/app/plugins/base.py index b19c509..8f3cf2a 100644 --- a/app/plugins/base.py +++ b/app/plugins/base.py @@ -97,6 +97,15 @@ class BasePlugin(ABC): """ return [] + async def register_event_handlers(self, event_bus: EventBus) -> None: + """Register event handlers for the background worker (ARCH-038 hook). + + The worker calls this on every active plugin at startup so plugins + can subscribe to events even when the web process is separate. + Default: no-op. Override to subscribe handlers. + """ + return None + # ─── Job Modules ─── def get_job_modules(self) -> list[str]: diff --git a/app/routes/entity_permissions.py b/app/routes/entity_permissions.py index 0b9aa9c..de77957 100644 --- a/app/routes/entity_permissions.py +++ b/app/routes/entity_permissions.py @@ -111,7 +111,7 @@ async def _check_entity_ownership( detail={"detail": f"Unknown entity type: {entity_type}", "code": "not_found"}, ) - model = model_info["model"] + model = model_info # ENTITY_MODELS maps directly to model classes try: eid = uuid.UUID(entity_id) except ValueError: