Files
Georgy ButaevandClaude Fable 5 d40648d4df fix(audit): principles sweep — repair 2 live schema-drift bugs + SSOT stragglers
Founder-mandated SSOT/DRY/SoC audit + fix pass (report:
docs/audits/2026-07-03-principles-audit.md). Live schema verified on the box.

Live bugs fixed:
- POST /api/research 500s: createResearch + Cat create_research inserted the
  9 denormalized counter columns dropped by migration 20260404000005; types
  (research.ts, database.ts) and the research dashboard no longer reference
  the dead counters either.
- Group-events APIs: profiles!group_events_creator_id_fkey /
  group_event_rsvps_user_id_fkey embeds 400 on live (FKs point at auth.users,
  not profiles). Split queries fetchEntityOwner-style via new shared
  services/groups/eventProfiles.ts across 4 server/browser consumers.

SSOT/DRY fixes:
- Refresh stale scripts/db/live-schema.json from the box (audit:schema clean:
  search_queries, user_economic_profile, payment_intents.lnurl_verify_url).
- ROUTES.DASHBOARD.CAT_WELCOME replaces 5x '/dashboard/cat?welcome=true';
  exported isCatHubPath() replaces ad-hoc startsWith checks.
- 5 hardcoded fetch('/api/…') moved to API_ROUTES (new WEBHOOK_ENDPOINTS.
  DELIVERIES, AUTH.OAUTH_PROVIDERS, DISCOVER.COUNTS).
- contextual-create.ts migrated to ROUTES.* + single COMPOSE_HREF.
- Fix 3 stale tests asserting the retired SATS currency code (failing on main).

Gates: type-check 0 · lint clean · 957/957 tests · audit:routes clean ·
audit:schema clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 12:53:50 +02:00
..