Migration SQL file existed but was never registered in _journal.json,
so Drizzle skipped it. Every voice recording insert failed with:
PG code 42703: column "transcription" does not exist
Co-Authored-By: Claude <noreply@anthropic.com>
Add user_profiles table, store, and background learner worker
that summarizes user communication style, topics, and personality.
- New user_profiles table (user_id PK, guild_id, profile_summary, last_analyzed_at)
- userProfileStore.ts — CRUD (get/update) following channelCultureStore pattern
- userProfileLearner.ts — background worker: queries 100 recent msgs per user,
calls LLM for personality summary, updates every 12h
- Inject <user_profile> XML tag per-message in moderation prompt
- Start worker alongside cultureLearner in aiAnalyzer.ts
- Migration 0008 for user_profiles table
Co-Authored-By: Claude <noreply@anthropic.com>
- 0000: CREATE TABLE IF NOT EXISTS, CREATE INDEX IF NOT EXISTS,
FK constraint wrapped in DO 539994 EXCEPTION WHEN duplicate_object
- 0001: ALTER ADD COLUMN wrapped in DO 539994 EXCEPTION WHEN duplicate_column
- 0002: CREATE TABLE IF NOT EXISTS, CREATE INDEX IF NOT EXISTS
- 0003: CREATE TABLE IF NOT EXISTS, CREATE INDEX IF NOT EXISTS
- 0006: ALTER ADD COLUMN wrapped in DO 539994 EXCEPTION,
DROP COLUMN IF EXISTS
Allows migrations to run cleanly regardless of DB state —
handles fresh DB, partial migration, or wiped __drizzle_migrations.
Co-Authored-By: Claude <noreply@anthropic.com>
- Standardize MessageRecord types — single source of truth from @bete/shared
- Clean up config: remove unused GUILD_ID/TEXT_GUILD_ID/TEXT_CHANNEL_ID, fix WEBSERVER_PORT default (3001), remove default admin password
- Move mascot_chat_messages table to Drizzle schema with proper migration
- Remove runtime DDL (CREATE TABLE IF NOT EXISTS) from mascot-chat repository
- Remove phantom analytics/ module from documentation
- Add better-sqlite3 dependency to root devDependencies
- Replace 'as any' casts with proper type assertions across AI moderation
- Add error logging to silent catch blocks in LLM client
- Apply Biome formatting and import organization
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Update the LLM client to support streaming responses and improve
database migration idempotency.
- Add `stream` support to `llmChat` with dynamic chunk parsing for
compatibility across different LLM providers.
- Remove hardcoded default temperature and top_p to allow for more
flexible parameter passing.
- Update database migrations to use `IF NOT EXISTS` for tables and
indexes to prevent errors during re-runs.
Adds new database schema migrations to support the implementation of
user reputation tracking and channel-specific culture context.
- Creates migration `0005_large_squadron_sinister.sql` containing
`user_reputations` and `channel_cultures` tables.
- Updates Drizzle migration journal to include the new migration step.
- Adds `fix_prompt.py` utility for managing prompt adjustments.
Table was defined in Drizzle schema at schema.ts:425 but no migration
existed. Runtime queries from text-cache-store fail with:
relation "corrected_moderations" does not exist
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Create new migration 0001_add_model_version_to_cache.sql to add model_version column to text_analysis_cache table (default 'v1')
- Add composite index on source + model_version for efficient cache lookups
- Improve git branch detection in textCacheStore.ts:
* Check CACHE_MODEL_VERSION env var first (required in Docker)
* Suppress stderr with stdio pipes to eliminate spurious warnings
* Log ERROR (not warning) when git unavailable AND no env var set
* Only fall back to 'v1' as last resort, preventing silent dummy usage
- Remove unused imports (logModelVersionChange, logCacheInvalidation) and previousVersion variable
- Fixes repeated 'column model_version does not exist' errors on bot startup
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Container crashed with 'Can't find meta/_journal.json file' because
Drizzle ORM migration files were never generated. Generated migrations
for all 10 schema tables and updated Dockerfile to copy drizzle/ to
/app/drizzle/ where the migrator expects them.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>