{"name":"Meta Fantasy Backend","version":"0.1.0-recap-poc-v0+be-mm-auth","invariants":"validate → persist → emit","mvp":{"tables":"leagues, users, teams, invites, players, player_game_stats, rosters, lineups, standings, transactions, event_log (11) + chat_rooms_bridge, chat_system_messages_log, sessions","events":"UserCreated, LeagueCreated, MemberJoined, RosterMoved, LineupSet, RecapRequested, RecapGenerated, SystemMessageRequested (8)","comms":"Mattermost single team fantasy, channel per league, bot welcome + recap publish via SystemMessageRequested — all via eventbus with retry + lazy repair","recap":"POST /api/internal/recap/generate {leagueId, week, season} -> 202 + chain RecapRequested->RecapGenerated->SystemMessageRequested->MM fl-{id} idempotent via recap:{leagueId}:w{week}:s{season}"},"conventions":{"errorShape":"{ error: { code, message, details? } }","validation":"zod via validate({ body, query, params })","writePath":"validate (zod) → persist (tx) → emit (transactional outbox via withWrite)","eventDriven":"Routes never call MM directly; eventBus handlers drive side-effects with dedupe+idempotency + retry + lazy repair"},"observability":{"requestId":"x-request-id header, echoed, AsyncLocalStorage, [A-Za-z0-9_-] len<=128","logger":"JSON per line with ts, level, msg, requestId when present, LOG_LEVEL default info, LOG_FORMAT json default pretty when APP_ENV=local","metrics":"/metrics Prometheus text, http_requests_total, http_request_duration_ms, event_emitted_total, event_handler_duration_ms, event_handler_failures_total, db_pool_connections","health":"/health liveness (no DB), /ready readiness (postgres check), /ready/data season stats loaded (503 when empty)"}}