From 1bc9925e40899a38ef78c6e19f1c04875f55f107 Mon Sep 17 00:00:00 2001 From: jay Date: Wed, 10 Jun 2026 18:48:47 -0400 Subject: [PATCH] Daily Word: server-adjudicate guesses (answer no longer in the response) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Codex's v2 hardening. The GET /api/puzzle/word response no longer carries the answer at all — guesses POST to /api/puzzle/word/guess and the server returns the colour pattern, computed against the day's answer. The answer (and the "why") are revealed only once solved or the guesses are spent. This removes the "open DevTools, read the answer" issue without pretending to be a fortress (a deliberate crafted request can still peek; there's no leaderboard or prize, so that's fine). Client keeps local progress/stats; dict validation stays client-side. Trade-off accepted: each guess needs the API (the site already depends on it for today's content). Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/src/lib/components/WordGame.svelte | 75 ++++++++++----------- goodnews/api.py | 16 +++++ goodnews/games.py | 49 +++++++++++--- tests/test_admin.py | 25 +++++-- 4 files changed, 110 insertions(+), 55 deletions(-) diff --git a/frontend/src/lib/components/WordGame.svelte b/frontend/src/lib/components/WordGame.svelte index 357f118..cb01ed2 100644 --- a/frontend/src/lib/components/WordGame.svelte +++ b/frontend/src/lib/components/WordGame.svelte @@ -1,18 +1,20 @@