Mystery Hunt Box + Ad Detective, badge tiers

Finish the day's Code Hunts to unlock one box a day. It opens to an Ad
Detective case on one site with a fixed 0.15 POL reward shown up front:
visit (the embed records the visit after the dwell, no code), then answer
one question, one attempt. Paid inside the house cap, never counted as a
find. 34-question bank seeded from lib/detective-bank.json; a hunter never
repeats a question until they have seen every one for that site. Admin
panel with per-question stats and retire/restore.

New badges (all ledger-derived): Detective, Sleuth, Investigator, Master
Detective; Scout, Guide, Trail Boss; Week Sweep; 7-Day Streak. Badges
already earned on deploy are marked announced without posting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-26 16:10:17 -05:00
parent 64ab0b505f
commit 469cbf69a5
25 changed files with 1334 additions and 423 deletions
+2 -1
View File
@@ -9,7 +9,8 @@ const { spawn } = require('child_process');
let PUBLIC_DIR = null, CACHE_DIR = null, FONT;
// per-badge ribbon position (fraction of height); tuned to the artwork
const ART = { first: 0.734, hunter: 0.753, tracker: 0.715, sweep: 0.689, lucky: 0.753, streak: 0.702, top: 0.725, recruiter: 0.834 };
const ART = { first: 0.734, hunter: 0.753, tracker: 0.715, sweep: 0.689, lucky: 0.753, streak: 0.702, top: 0.725, recruiter: 0.834,
/* 2026-09-26 set, measured on the art */ detective: 0.82, sleuth: 0.899, investigator: 0.793, masterdetective: 0.879, scout: 0.744, guide: 0.794, trailboss: 0.809, weeksweep: 0.794, weekstreak: 0.789 };
function init(opts) { PUBLIC_DIR = opts.publicDir; CACHE_DIR = path.join(opts.dataDir, 'badges'); try { fs.mkdirSync(CACHE_DIR, { recursive: true }); } catch (e) {} }
function artFile(id) { return path.join(PUBLIC_DIR, 'badges', 'badge-' + id + '.jpg'); }