- C1: add orgId field to _tasks/_workflows, filter all queries by org
- C2: validate spaceID/orgID with regex before Temporal visibility queries
- H1: add sync.RWMutex to orgClients map (prevent concurrent map panic)
- H2: atomic FailTask with CASE expression (eliminate TOCTOU race)
- H4: extractCreator uses authenticated user ID, not raw headers
- Add orgId to collection schemas, store methods, and API filters
- durable.go: add sync.RWMutex to orgClients map — concurrent writes
to unprotected map caused panics under load. Double-checked locking
pattern for connection caching.
- workflows.go: AgentTaskWorkflow now listens for claim/complete/fail/
progress/cancel signals. Previously signals were accepted by Temporal
but silently dropped (workflow had no signal channels). Now supports
both auto-execute (activity) and signal-driven (human/agent-in-loop)
patterns simultaneously via selector.