Add multiplayer UNO, room sentiment tracking, and audit fixes

- Multiplayer UNO: lobby system (2-4 humans + bot), DM-based turns,
  30s auto-play timer, winner-takes-all pot, forfeit handling
- Solo UNO: refactor bot AI to shared standalone functions, support
  starting games from DM, passive UNO call system
- Room sentiment: new room_sentiment_stats table and !roomsentiment
  command showing per-room sentiment breakdown with percentages
- Stop purging llm_classifications (retain indefinitely for analytics)
- Fix multiplayer UNO audit issues: dead code in initMultiGame,
  double game.turns++ on human plays, missing !uno status command
- Update README with UNO commands, config, and architecture

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-03-13 10:26:50 -07:00
parent 7c9dd28021
commit e0a201ef97
6 changed files with 1891 additions and 63 deletions

View File

@@ -150,9 +150,6 @@ func RunMaintenance() {
{"wotd_log", `DELETE FROM wotd_log WHERE date < ?`, []interface{}{date90d}},
{"wotd_usage", `DELETE FROM wotd_usage WHERE date < ?`, []interface{}{date90d}},
// LLM classifications — keep 30 days
{"llm_classifications", `DELETE FROM llm_classifications WHERE timestamp < ?`, []interface{}{cutoff30d}},
// Daily activity older than 1 year
{"daily_activity", `DELETE FROM daily_activity WHERE date < ?`, []interface{}{now.AddDate(-1, 0, 0).Format("2006-01-02")}},
}
@@ -589,6 +586,21 @@ CREATE TABLE IF NOT EXISTS sentiment_stats (
total_score REAL DEFAULT 0
);
CREATE TABLE IF NOT EXISTS room_sentiment_stats (
room_id TEXT PRIMARY KEY,
positive INTEGER DEFAULT 0,
negative INTEGER DEFAULT 0,
neutral INTEGER DEFAULT 0,
excited INTEGER DEFAULT 0,
sarcastic INTEGER DEFAULT 0,
frustrated INTEGER DEFAULT 0,
curious INTEGER DEFAULT 0,
grateful INTEGER DEFAULT 0,
humorous INTEGER DEFAULT 0,
supportive INTEGER DEFAULT 0,
total_score REAL DEFAULT 0
);
-- Daily prefetch tracking
CREATE TABLE IF NOT EXISTS daily_prefetch (
job_name TEXT NOT NULL,
@@ -697,6 +709,20 @@ CREATE TABLE IF NOT EXISTS uno_games (
ended_at DATETIME NOT NULL
);
-- Uno multiplayer
CREATE TABLE IF NOT EXISTS uno_multi_games (
id INTEGER PRIMARY KEY AUTOINCREMENT,
room_id TEXT NOT NULL,
ante REAL NOT NULL,
pot_total REAL NOT NULL,
winner_id TEXT NOT NULL,
player_ids TEXT NOT NULL,
result TEXT NOT NULL,
turns INTEGER NOT NULL,
started_at DATETIME NOT NULL,
ended_at DATETIME NOT NULL
);
-- Space groups (rooms with overlapping membership)
CREATE TABLE IF NOT EXISTS space_groups (
room_id TEXT PRIMARY KEY,