Game Pass: tournament/pending answers rows (the field the games' polgrant.js reads), games-side integration test, docs "Games: as built"

- /api/partner/tournament/pending returned only `pending`; every game's polgrant.js tournamentPending() reads `rows`, so
  PolHunter's prize payer would never have seen a row. Answer now carries both (`pending` stays for the admin pane + qa).
- qa/gamepass-games.cjs (bash qa/run.sh gamepass-games): boots a local copy like qa/gamepass.mjs and drives the REAL
  spooky-doors/server/polgrant.js and polhunter/lib/tournament.js against it (fetchPass, daily/progress caps, carry:<day>
  zero-POL call on the next Central day, void, bad secret / IAP down -> retry, retry queue, tournament dry run + live). 44/44.
- qa/gamepass.mjs pins the `rows` field.
- docs/GAME-PASS.md: 3a item 8 updated, "Games: as built" section merged from the games' notes (per game files/refs/perk/tests,
  decisions, the tournament payer and its dry-run claim trap, the integration test).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-10-16 09:27:46 -05:00
parent 4d6a0f2f83
commit 084d1ea3d6
5 changed files with 272 additions and 6 deletions
+1 -1
View File
@@ -174,7 +174,7 @@ try {
let pend = await api('/api/partner/tournament/pending', null, adminH);
ok(pend.j.ok && pend.j.pending.length === 1 && pend.j.pending[0].place === 1 && near(pend.j.pending[0].pol, 1.25), 'GET /api/partner/tournament/pending (admin) lists the unpaid prize', JSON.stringify(pend.j.pending));
pend = await gameGet('/api/partner/tournament/pending', { game: 'gemkingdom' }, 'tournament', GK);
ok(pend.status === 200 && pend.j.pending.length === 1 && pend.j.pending[0].email === A, 'a game can read the pending prizes with its signature', '');
ok(pend.status === 200 && pend.j.pending.length === 1 && pend.j.pending[0].email === A && Array.isArray(pend.j.rows) && pend.j.rows.length === 1, 'a game can read the pending prizes with its signature (answer carries `rows`, the field the games\' polgrant.js reads)', '');
let paid = await gamePost('/api/partner/tournament/paid', { game: 'gemkingdom', week: '2026-10-19', place: 1, tx: '0xabc123' }, GK);
ok(paid.j.ok === true, 'a game marks the prize paid', JSON.stringify(paid.j));
pend = await api('/api/partner/tournament/pending', null, adminH);