Missions reset with the Central day: a find blocks a mission only for that day (member id or wallet); tag reads Done today

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-09-20 07:13:46 -05:00
parent 85f710f322
commit f1e1886f48
5 changed files with 19 additions and 9 deletions
+5
View File
@@ -62,6 +62,11 @@ const sleep = ms => new Promise(r => setTimeout(r, ms));
eq([ok.status, ok.body.pol >= 0.05 && ok.body.pol <= 1, ok.body.queued, ok.body.unlocked], [200, true, false, ['first', 'sweep']], 'the right code pays a drip in range, not queued, and unlocks First Find (and Full Sweep: the test has one site)');
const twice = await call('/api/my/submit', { method: 'POST', body: JSON.stringify({ token: t, code: code.code }) }); eq(twice.status, 400, 'the same mission cannot be claimed twice');
const b2 = await call('/api/my/board'); eq([b2.body.missions[0].done, b2.body.drips.length, b2.body.drips[0].status], [true, 1, 'due'], 'board: done, one drip due (faucet off, so it waits)');
// missions reset with the Central day: a find dated yesterday no longer blocks the mission today
{ const fs3 = require('fs'); const pf = path.join(DIR, 'payouts.json'); const all = JSON.parse(fs3.readFileSync(pf, 'utf8')); const yd = new Date(Date.now() - 86400000).toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }); all[0].day = yd; fs3.writeFileSync(pf, JSON.stringify(all));
const b2b = await call('/api/my/board'); eq(b2b.body.missions[0].done, false, 'yesterday’s find does not mark the mission done today');
const again2 = await call('/api/my/start', { method: 'POST', body: JSON.stringify({ missionId: 'test-1' }) }); eq(again2.status, 200, 'the mission can be started again the next day');
all[0].day = new Date().toLocaleDateString('en-CA', { timeZone: 'America/Chicago' }); fs3.writeFileSync(pf, JSON.stringify(all)); }
// the daily pool: once today's committed POL reaches the cap, the board says so and new starts are
// refused until the next Central midnight (Marty, 2026-09-19)