1 Commits
Author SHA1 Message Date
db284f5f96 refactor(ai): one platform-LLM path, one eval auth helper (#676)
Two duplicated blocks, both now living once:

- intent-router and offer-engine each carried their own copy of the
  platform provider call (Groq-first, OpenRouter fallback, json_object,
  failure logging). Both now go through callPlatformJson in
  platform-llm.ts — the SSOT the other four structured Cat features
  already use — so provider choice and the json-mode 400-retry apply
  everywhere, once. form-prefill-service stays separate on purpose: it
  accepts a user-supplied API key/model, so it is not a pure platform
  call.

- signIn/buildAuthCookie (GoTrue REST + forged @supabase/ssr cookie) was
  copied across eval-cat, eval-voice-routing and eval-wallet-routing.
  Extracted to scripts/eval-auth.mjs; deploy-selfhost.sh ships it next
  to eval-cat.mjs so the nightly timer on the box keeps resolving the
  import.

Verified: tsc clean, lint clean, 2153 unit tests green, and
eval:voice 13/13 against production through the new auth path.

Co-authored-by: Georgy Butaev <41178744+g-but@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-11 16:28:38 +00:00