fix: canonicalize operations work items

This commit is contained in:
plx
2026-08-15 00:32:38 +00:00
parent 9b3c3b32ef
commit fabadbffdc
4 changed files with 1041 additions and 16 deletions

View File

@@ -302,8 +302,9 @@ def get_opportunity_next_actions(opportunity_ids: Iterable[str]) -> Dict[str, Di
if not ids:
return {}
from app.operation_service import ensure_operation_schema
ensure_operation_schema()
# Read path only: schema creation belongs to startup/migrations. In
# particular, GET /operations must never perform DDL while calculating its
# canonical projection.
with engine.begin() as conn:
opportunities = _bulk_rows(conn, """
SELECT id::text, stage, status, title,