perf: resolve active workspace once per request instead of per procedure (#2470) master
* perf: resolve active workspace once per request instead of per procedure Batched tRPC requests re-ran the same user脳workspaces query for every procedure in the batch. Memoize the resolution on the request-scoped context so a batch of N procedures costs one Turso round-trip. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * test: cover protectedProcedure auth and per-request workspace memoization Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * refactor: make resolveWorkspace zero-arg to remove ignored-args footgun The memoized resolver previously accepted (userId, workspaceSlug) but silently discarded them after the first call. Bind both at context creation instead so the signature can't promise a parameterized lookup it doesn't perform. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>