The Draft on the real holding tank (2026-11-15, LOCAL ONLY): tankpool.js 'iap' mode = signed client for InstantAdPay's draft partner routes

TANK_MODE=iap (or hub) + IAP_URL + DRAFT_PARTNER_SECRET: pool / adopt / release / status as HMAC-signed POSTs ('draft.v1.' + ts +
newline + body, X-Draft-Ts / X-Draft-Sig). The stub stays the default and keeps every existing test. adopt carries the coach claim
(wallet, hubId, username, positions = store.positionsOf) and a request id; one retry with the same rid on a network failure, so a
retry never makes two adoptions. release sends why 'coach' | 'return' + the pick's iap ref and takes InstantAdPay's outcome
(returned / kept / done). league.sweep follows a pick InstantAdPay closed first (its own 3-day sweep, a release there, a LinkSpin
follow). Surfing arrives as ad credits (surfCredits, shown "N ad credits" to coaches, +10 scouting like surf POL); games stay
"not tracked yet" (InstantAdPay has no per-member game record).

Fix found by the cross test: a tank refusal about the COACH (no InstantAdPay account, full, not vested, hub off) used to mark the
person unavailable and let the same coach choose again, which would burn the whole pool; now the slot passes (skip 'tank: <code>')
and a silent tank pauses the draft (nothing recorded, the next tick retries the same slot). Manual picks record nothing on either.

Tests: unit 62/62 (2 new: skip + wait), smoke 156/156 (ports 3561-3564), qa/iap-tank.test.cjs 23/23 (this client + league against
InstantAdPay's REAL draftpartner.js + tank.js from the sibling checkout behind a signed server on 3565, then a dead port 3566).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-15 07:18:00 -06:00
parent f26ac15712
commit 8645b471ae
11 changed files with 267 additions and 29 deletions
+1 -1
View File
@@ -37,7 +37,7 @@
else if (coach) act = '<button type="button" class="btn" data-queue="' + esc(p.id) + '">' + (queued ? 'ON MY QUEUE' : 'ADD TO QUEUE') + '</button>';
else act = '<a class="btn" href="/join">GET A POSITION</a>';
const rows = [['Game plays', p.plays == null ? 'not tracked yet' : FX.n(p.plays)], ['Plays', p.game || (p.plays === 0 ? 'none yet' : p.plays == null ? 'not tracked yet' : 'none yet')]];
if (coach) rows.push(['Earned in games', pol(p.gameWei)], ['Earned surfing', pol(p.surfWei)]);
if (coach) rows.push(['Earned in games', pol(p.gameWei)], ['Earned surfing', p.surfWei == null && p.surfCredits != null ? FX.n(p.surfCredits) + ' ad credits' : pol(p.surfWei)]);
rows.push(['Last seen', FX.ago(p.lastSeen, b.now)], ['Came from', p.door || 'not tracked yet'], ['Wallet', p.wallet ? 'linked' : 'not yet']);
return '<article class="scout"><div class="hd"><b>@' + esc(p.username || 'player') + '</b>' + (p.hot ? '<span class="tag">HOT</span>' : '') + '</div><div class="bd">'
+ rows.map(r => '<div class="kvr"><span>' + r[0] + '</span><b>' + esc(r[1]) + '</b></div>').join('') + '</div><div class="ft">' + act + '</div></article>';
+1 -1
View File
@@ -61,7 +61,7 @@
$('fKick').textContent = label + ' · ' + p.tierName.toUpperCase();
$('fName').textContent = '@' + (p.username || 'player');
$('fWhen').textContent = 'Picked ' + FX.when(p.at) + (p.status === 'open' ? ' · ' + (p.daysLeft ? p.daysLeft + ' day' + (p.daysLeft === 1 ? '' : 's') + ' left to start' : 'goes back to the pool today') : ' · started, stays on your team');
$('fStats').innerHTML = [['Game plays', p.plays == null ? 'not tracked yet' : FX.n(p.plays) + (p.game ? ' (' + p.game + ')' : '')], ['Earned in games', pol(p.gameWei)], ['Earned surfing', pol(p.surfWei)], ['Came from', p.door || 'not tracked yet'], ['Last seen', FX.ago(p.lastSeen)]]
$('fStats').innerHTML = [['Game plays', p.plays == null ? 'not tracked yet' : FX.n(p.plays) + (p.game ? ' (' + p.game + ')' : '')], ['Earned in games', pol(p.gameWei)], ['Earned surfing', p.surfWei == null && p.surfCredits != null ? FX.n(p.surfCredits) + ' ad credits' : pol(p.surfWei)], ['Came from', p.door || 'not tracked yet'], ['Last seen', FX.ago(p.lastSeen)]]
.map(r => '<div class="kvr"><span>' + r[0] + '</span><b>' + esc(r[1]) + '</b></div>').join('');
$('fSteps').innerHTML = stepsHtml(p.steps);
const h = D.help.find(x => x.pickId === p.id);