Pool admin: delete any word (tombstones + restore) + bulk import

Daily Word pool curation, full add/delete/import — no redeploys to fix tone:
- Remove ANY pool word, curated or admin-added, via a word_pool_removed
  tombstone table. Runtime pool = (static ∪ added) − removed, so even a
  baked-in word can be pulled on negative feedback. Reversible: a "Removed"
  list with one-tap Restore lifts the tombstone. Lookup now surfaces a Remove
  button when in-pool, Restore when removed.
- Import a vetted list (paste or .txt/.csv upload, read client-side): validates
  each word (alpha · 5–6 · in guess dictionary), ignores duplicates, and reports
  rejects with reasons. Re-adding/importing a removed word lifts its tombstone.
- Word Search theme delete already existed (Edit/Remove per theme) — verified.

Pool stays the clean 251/224; today's noisy LLM enrichment is discarded.
Tests: +tests/test_pool_admin.py, extended test_word_pool_admin. 222 pytest +
11 vitest green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
jay
2026-06-11 17:17:16 -04:00
parent fb781f48b8
commit 2461584052
6 changed files with 352 additions and 19 deletions
+7
View File
@@ -283,6 +283,13 @@ CREATE TABLE IF NOT EXISTS word_pool (
PRIMARY KEY (variant, word)
);
CREATE TABLE IF NOT EXISTS word_pool_removed (
word TEXT NOT NULL,
variant TEXT NOT NULL, -- '5' | '6'
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (variant, word)
);
CREATE TABLE IF NOT EXISTS daily_puzzles (
id INTEGER PRIMARY KEY AUTOINCREMENT,
puzzle_date TEXT NOT NULL,