- ads.js: a login buy with every slot taken returns full:true and a reserve offer; with reserve:true it is charged the full slot price at once (purchased credits only, credit log 'Login slot reserved (queue #N)') and stored with status 'queued' + queuedAt, no starts/expires, never served or counted as a slot. First paid, first served.
- Promotion (promoteLoginQueue): on a slot expiring (scheduleSweep), a member pausing a slot, every new login buy, and a one-minute tick. The oldest reservation becomes active, starts now, ends in 30 days; the owner gets an on-site notice (kind 'notice') and an email unless unsubscribed.
- Deploy-overlap safety: the cap decision runs under a lease row in the new app_locks table (one conditional UPDATE takes it, an expired lease can be taken over); every start/cancel/edit is a conditional UPDATE on status='queued', so a reservation starts at most once and a cancel racing a start has exactly one winner. Live login buys and paused-slot resumes also take the lease, so the cap holds for them too.
- A freed slot goes to the line first: a paused slot resumes only while live + queued < loginSlotsMax, with a plain message saying the line is ahead.
- Cancel before the start: full refund as purchased-grade credits (credit log 'Login slot reservation cancelled: refund'), once. Edit target/image/headline before the start, free. Cancelled reservations can be archived.
- Estimated start per place from the live slots' end dates and the reservations ahead, shown in Central time and labelled an estimate.
- db.js: campaigns.queued_at BIGINT NULL, app_locks table + 'login_queue' row, all added on boot.
- server.js: loginLine in GET /api/my/campaigns, POST /api/my/campaigns/:id/cancel-reservation and /edit-reservation (safe-browsing, reach and image checks), GET /api/admin/login-queue, POST /api/admin/login-queue/:id/cancel, the promotion notice hook and the one-minute tick.
- Member UI (my.js, my.html): open slots or the line with place and estimated start on the Login ad form, the button becomes "Reserve the next slot", IAP.confirmBox before paying, In line #N + estimated start in the list, Edit and Cancel and refund. Admin (admin.js, admin.html): Login-ad line card with owner, queued at, place, estimated start, cancel + refund. Tags bumped to 20261023lq.
- chatbot.js: new canned 'login-ads' answer and the LOGIN ADS fact updated (6 slots, the paid line, cancel = full refund before start). The knowledge base seeds the new entry on boot.
- audit.js: queued/cancelled reservations are not per-day login campaigns.
- QA: qa/login-queue.cjs (JSON store end to end) and qa/login-queue-sql.cjs (SQL path guard logic against a fake SQL layer), bash qa/run.sh login-queue. qa/login-slot.mjs pattern follows the refactor.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deliberate sponsor changes (tank adoption, dormant-lead rescue, release, adoption window ending, admin edit) are now
recorded (sponsorfollow.json: when, how, the sponsor before, origin) and travel on the LinkSpin sync rows as
sponsorSetAt/By/PrevEmail/Origin. A deliberate change from LinkSpin is applied here (a clear back to the tank included)
only when the member is not bound on the InstantAdPay contract (memberId or wallet on chain), it is newer than our own
deliberate change, and both sides agreed before it (or we have no sponsor). Bound, diverged and race cases change
nothing and are logged. Race within 15 min: the earlier change wins on both. Ordinary bindings keep the first-platform
rule. Accounts with no record behave as before; rows without the new facts hash exactly as before (no resend on deploy).
Network tank: rows carry this site's own adoptions of a person; the waiting list hides someone adopted on LinkSpin, the
two-adoptions limit counts both sites, the 3-day hold applies to a LinkSpin adoption too, follows close local open
adoptions quietly (no chat, mail or feed post).
Admin > Members > Sponsor check: shared members whose sponsor differs or is one-sided, each side's when/how, chain
binding, and Use InstantAdPay's / Use LinkSpin's sponsor (applied on the other site, refused when bound there).
Partner endpoints /api/partner/sponsor-facts and /api/partner/sponsor-apply (same HMAC as the registry rows).
Tests: qa/sponsorfollow.test.cjs 27/27, qa/sponsorfollow-e2e.mjs 20/20 (local IAP + local LinkSpin, throwaway data),
QA member walk 0 bugs. No sponsor was changed on production.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- kb.js: entries { id, title, questions, answer, tags, pattern, handoff, order, source, updated } in MySQL table kb_entries (created on boot) or DATA_DIR/kb.json without DATABASE_URL. BM25 over title, question variants and tags (answer at a low weight) with word bigrams; the top hits (within 30% of the best, score 3+) go into the system prompt as KNOWLEDGE BASE, and when nothing fits the prompt says to answer "I'm not sure, ask support".
- One source: chatbot.js CANNED seeds the KB (ids c-*, its regex becomes the entry's instant-answer pattern, same first-match order), kb-seed.js seeds the home FAQ, Platform Facts, wallets FAQ and the Coinbase support reply (f-*). The fast path now serves the KB entry, so an admin edit changes the instant answer; the in-code CANNED only answers if the KB store fails. Unedited seeds follow code changes, edited ones are left alone, deleted seeds stay deleted.
- Admin > Knowledge base: list, search, filter by source, add, edit, delete, and Try a question (instant answer or what the AI is given). Support tickets: "Save as KB entry" under each sent reply opens a draft with the member's question and the reply (greeting and sign-off trimmed). Em dashes in admin input become commas.
- chatbot.js: OPENROUTER_URL override for tests; solo-ads answer em dash removed; KNOWLEDGE_DATE 2026-10-20.
- qa/chatbot-sync.mjs: takes the later of KNOWLEDGE_DATE and /api/chat/kb-stamp (newest KB edit by a person, Central day; seed refreshes do not count).
- QA: qa/kb-retrieval.cjs (13 sample questions rank the right entry first, off-topic returns nothing), qa/kb-chat.mjs (local copy + mock OpenRouter: Coinbase answered from the KB, fast path without an AI call, admin CRUD, restart keeps edits), bash qa/run.sh kb; walk covers admin#kb and Save as KB entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Islands and looks in Shards of Valor, never power and never more POL: every tier gets exactly the weekly pass caps and polgrant
still answers pass: true. Per-tier expiry side by side (record.tiers, legacy until mirrors weekly, lazy migration); flag() adds
tier (highest active) and tiers; hand-off token gamePass { active, until, tier }; /api/partner/player pass { active, until, tier,
tiers }. Buy { tier } with purchased credits or a waiting order per tier that a big-enough package fulfils (highest price first,
each tx once). No auto-renew, no proration. Admin: per-tier stats (Central week/month), comp per tier, end-a-tier (refund).
Tournament pool keeps weekly sales only unless passTournamentTierSales. Member card shows three tiers; /my#passes opens it.
Tests: qa/sov-passes-store.cjs, qa/sov-passes-local.mjs (bash qa/run.sh sov-passes). Cache tags my.js/admin.js 20261018tiers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Game sign-in kit (game-signin.js): after a fresh email sign-in (never a remembered
pass) the kit shows the login ad before the hand-off to /auth?t=, same as the
dashboard: sponsor card, Open Ad (a counted click through /api/ads/click), sponsor
framed in a full-screen overlay when frameable else a new tab, 10 s countdown
(loginDwellSeconds), then Continue to the game. No ad, an error, a non-200 or a
7 s stall all go straight to the game. A game page whose CSP blocks the frame gets a
new-tab link instead. mount option loginAd: false switches it off.
- GET /api/game/ads/login?game=<slug>: CORS only for that game's GAME_AUTH origins
(dev: localhost); the dashboard /api/ads/slot route keeps no CORS. Both share
loginAdFor() (ads.serve: impression + lastShownDay as before). Drip Runner and
PolyBreak are marked frames: false (their CSP is default-src 'self'), so their ad
opens in a new tab; frame checks for games ignore an instantadpay.com-only
frame-ancestors allowance.
- loginshows.js: every login-ad request tallied per Central day, surface (dashboard or
game slug) and kind (member slot, house, none); MySQL table login_shows (created on
first use) or DATA_DIR/login-shows.json. GET /api/admin/login-shows + a Login-ad
showings card on the admin Traffic pane (dashboard vs games, house, no-ad, by game).
- The kit is served no-cache so games pick it up without a tag bump; admin.js tag bumped.
- Chatbot fact updated (slot rules + games), KNOWLEDGE_DATE 2026-10-18.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- chargeCredits takes opts.purchasedOnly (new poolShare helper, JSON + MySQL): the
1,000-credit slot charge draws only the credited purchased-grade pool, the rest burns
on-chain; viewing credits never pay, even when the member holds enough of them.
- setStatus: resuming a paused member login slot is refused while 3 are live
(loginSlots() helper, exported).
- topUpCampaign refuses login slots; the dashboard no longer offers Buy more views on one.
- audit: the days-charged check skips 30-day slots (expires set).
- JSON grantWelcome keeps the purchased grade, milestones and streak fields.
- my.js cache tag bumped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
POST /api/partner/support/{create,list,view,reply,token,token-reply}, signed exactly
like the registry rows (LS_SYNC_SECRET, X-LS-Ts + X-LS-Sig, now one readLsSigned helper
shared with /api/partner/registry). Only platform 'linkspin' tickets are reachable there.
LinkSpin tickets: requester mail, links and footer say LinkSpin support and point at
LS_URL (/support/t/<token>, /help#t=<ref>); no InstantAdPay in-app notice is sent for
them. Telegram ping, admin mail and the support bot's thread/list views mark them
LinkSpin. The member Help pane here lists InstantAdPay tickets only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- tickets.js: one shared desk (platform iap now, linkspin later), dual-mode store (MySQL tables tickets + ticket_messages, else support.json); refs IAP-<1000+id> / LS-; private no-login link /support/t/<ref>.<HMAC> signed with DATA_DIR/support.key (or SUPPORT_SECRET); ingestEmail() ready for the support@ intake step (threads by Message-ID, then [ref] in the subject from the same sender)
- Member Help pane (/my#help): list with status + unread badge, new ticket (category, subject, message, up to 2 screenshots via /api/my/upload), thread + reply (a reply reopens a closed ticket)
- Public /support: name, email, category, subject, message behind the sign-up walls (honeypot, form age, per-IP limits with the icon check, global cap) plus a per-email cap; confirmation email with the ref and the private link
- Chatbot: CANNED + systemPrompt know the help desk; answers that cannot help (or "talk to a human") offer "Send this to support", which files the last turns as a ticket (members: Help pane; signed out: email + the same guard)
- Admin Support pane: open / waiting / closed / all, platform, category, search; open-count badge; ticket view with requester account info, internal notes, status/priority/category, saved replies (site setting supportTemplates); deep link /admin#support?t=<ref>
- Notifications: new ticket / member reply -> Telegram to Marty's private chat only (supportTelegramChat, default 1289244227, site bot then Hermes fallback, never a group or the Discord relay) + email to ADMIN_EMAIL, max one per ticket per 10 min; Marty's reply -> email "[IAP-1042] subject" + a 'notice' inbox message for members, bursts batched
- support* settings are kept out of /api/config; Support link in the site footer, home footer, member page foot, terms and privacy; "Contact support" errors point at /support
- QA walk: member Help ticket flow, admin Support pane + deep link, internal-note leak check, public /support + private link + tampered token + form-age refusal
- Cache tags: common.js 20261016a, chat.js 20261016a, my.js 20261016r, admin.js 20261016sp, support.js 20261016a
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- /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>
- gamepass.js: durable pass store, waiting orders fulfilled by the next $5 package, cap ledger
(daily/total per Central day, progress deferral + next-day carry-forward, idempotent refs kept 90 days,
void), weekly Pass Tournament (Monday 9 AM Central, marks.claim, prizes recorded for the game faucets),
admin stats. Settings in site config, caps enforced only from capsStartDate (recorded before).
- server.js: /api/partner/player, /api/partner/polgrant(+/void), /api/partner/tournament/pending|paid,
/api/my/gamepass(+/buy), /api/admin/gamepass/stats|comp|tournament/run; gamePass claim on every
sign-in hand-off token; purchase-event fulfilment inside the marks.claim block.
- Members > Games: Game Pass card (Buy via IAP.confirmBox, deep link /my#games?pass=1), Overview nudge
after a free-cap hit. Admin > Game Pass pane. Chatbot canned answer + FACTS, KNOWLEDGE_DATE 10-16.
- qa/gamepass.mjs scripted test (bash qa/run.sh gamepass), Games tab card in qa/walk.mjs.
- docs/GAME-PASS.md: 3a clarifications + Built section; docs/GAME-PASS-RELEASE.md draft (not sent).
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- Licence value now books the money each leg actually moved for it (its own share of the level), not the full level price; labelled "licence value funded" with a note on what a licence-granted level costs the system
- gStartRun: after replaying an org, money counters reset but members keep every level they hold, licence-won ones included, and keep what they actually paid in
- Joins with no recruiter go to the top position (spread placement) instead of the earliest member with one recruit, which qualified members who never brought a second
- Sponsor-leg licences respect the gap toggle (skip vs fund), like the depth leg
- "Paid" counts cash or entry share only; pool-only members are reported apart
- The climb and the drawn tree are labelled as simplified depth-only illustrations; headline numbers come from the month-by-month run
- Cache tag bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>