Commit Graph

82 Commits

Author SHA1 Message Date
martbost 7f80d82486 Game Pass tier testing moves to Admin > Game Pass (Marty 2026-10-25): the member Games card shows every account, the admin's included, exactly what a member sees (weekly pass only while sovTiers is off; a holder sees the tier they hold). The /my admin preview note and the admin bypass on GET /api/my/gamepass and POST /api/my/gamepass/buy are gone. New Admin > Game Pass > Tier test and preview card (labelled TEST / PREVIEW): all five tiers as members will see them with on-sale/hidden chips and the admin's own status, Test buy (real waiting order fulfilled by a fresh package), Cancel test order, Give my account (test comp, no sale), End. New admin-only routes GET /api/admin/gamepass/preview, POST /api/admin/gamepass/test-buy | test-cancel | test-comp, always on the signed-in admin's own account. sovTiers untouched. QA: sov-passes-local + store reworked to the new flow (all pass); my.js and admin.js ?v= bumped.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 08:37:17 -05:00
martbost 50337bfbbc Refuel Kit (Fuel Your Offers stage 3, Marty approved 2026-10-24): monthly members-only banner sets for InstantAdPay, unlocked by the member's next counted refuel. kit.js (the same file ships in LinkSpin): kits as data in DATA_DIR/kits (month, theme, released, one base image each for 728x90 300x250 468x60 160x600 1200x630, this site's own program only); a counted refuel unlocks the kit of its Central month (refuel.js now keeps rec.kits month -> streak month, exposed in view.kits); kits stay usable after their month, a missed refuel only stops new ones, a kit released early waits for its month. Server-side personalization per member with ffmpeg (badge renderer approach): @username on a dark strip + a QR code (qrcode package) to their own /join link at fixed spots per size; cached in DATA_DIR/kits/out and served publicly at /kitimg/<hmac>.png|jpg|gif (only files rendered for entitled members; names cannot be guessed and change with the art). Streak month 3+ adds an animated GIF (three-frame loop), month 6+ records a BannerKitAI custom-banners credit (entitlement + note, no integration). Member: Promo tools Refuel Kit card (fuel.js?v=20261024kit): Make mine, Animated, Download, Copy image link, "Use in an IAP banner campaign" (opens Campaigns and prefills banner type, size, name, image URL and the member's link). Admin: Settings > Refuel Kit (admin-kits.js): month + theme, upload the five sizes, "Use placeholder art (public/banners)", preview with any username (still or animated), release (needs all five sizes). Behind the refuelStreak switch (myKits { on:false } while off). Chatbot CANNED + FACTS mention the kit. No paid image APIs; placeholder art = existing public/banners. qa/refuel-kit.test.cjs 8 checks (admin validation, switch, unlock by month, Pit Stop does not unlock, kits persist, GIF at 3, credit at 6, exact render sizes for all five, GIF loop, cache, unguessable serving, preview).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:44:27 -05:00
martbost ebdab6c545 Restore each file's original line endings (the override commit rewrote CRLF/LF)
No content change: server.js back to CRLF, my.js/admin.js/html back to LF, so the override
commit's real diff is ~800 lines, not 13,000.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:16:08 -05:00
martbost 43e841721a Level 4 override payer, shipped OFF (Marty approved 2026-10-23)
override.js: the weekly payer for the 3% level-4 override. It pays only when overrideMode is 'live' AND
overrideGoLive is set AND OVERRIDE_PAYER_KEY (or _FILE) is present; otherwise the Monday dry-run report
runs as before. Default stays 'dryrun'. Nothing in this commit moves money.

- Week = Monday 00:00 to Monday 00:00 Central; settled from 9 AM CT the Monday after, weeks in order.
- Plan frozen once per week (claim plan:<week>), one row per recipient (POL wei summed), on the volume.
- Claims fail closed: exclusive file create on the shared volume plus event_marks when MySQL is on.
- Row marked 'sending' before the tx, tx hash stored on acceptance; lost answers become 'review' and are
  never re-sent (settled from the chain index or by the admin). Pre-flight revert = carried, no gas.
- Dust under overrideDustPol (0.01) carried to next week; overridePayCapPol (100) holds the whole week;
  wallet must cover total + gas or nothing is sent; Telegram alerts once each.
- Telegram summary to Marty's private chat says PAID with tx links.
- Members: AwardPaid from the payer emails + on-site notice "Your Level 4 override is paid" and shows in
  Earnings as "Level 4 override" (common.js / my.js tags bumped to 20261023ov).
- Admin: /api/admin/override adds week status + payer state; POST /api/admin/override/pay (only when live)
  and /api/admin/override/resolve; P&L pane card with "Pay this week now" shown only when live.
- Comp plan (earning.html) + Platform Facts card hidden behind data-when="override-live" (shown only when
  overrideMode is live). Chatbot copy drafted in D:/tmp/override-copy, TODO in chatbot.js.
- qa/override.test.cjs (bash qa/run.sh override): 30 checks on a fake chain/signer/DB, throwaway data.

Reconciliation 2026-10-23: the dry run reads every Purchase in chain-index (229 events, full history);
per Central week it matches the index exactly. The ~$1,775 figure was the rolling 7 days 09-10..09-17.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:14:58 -05:00
martbost eac83c3eee Admin member card: visit packs show delivered visits as 'N of M visits' (Marty 2026-10-23); admin.js tag bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:35:22 -05:00
martbost 89b5969b25 Prepaid login-ad line: when all member slots are taken, members pay now to reserve the next one (Marty, 2026-10-23: "they need to pay for the slot now to get a place in line")
- 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>
2026-10-23 07:14:57 -05:00
martbost 31b167e046 Game Pass package rail, part two: Admin > Game Pass gets a Pass sales table (every sale labelled package / credit-paid (old rule) / package (old rule), pass value, package value, package tx link) and stats passes.pay + sales; the chatbot canned answer, tier fact and system prompt say every pass is paid by a new package bought after tapping Get (sponsor and team paid, credits kept for ads, held credits never buy a pass); docs/GAME-PASS.md "Payment: the package rail" section; release-note update draft (not sent); admin.js tag bumped. Fulfilment stamps the pass at the event time again (as before). Tests: sov-passes store + local rebuilt on order + fresh package (seeded credits never spent), gamepass ALL PASS, member walk 0 bugs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:49:39 -05:00
martbost 839c867595 Pass tiers restructure (Dallas, Marty approved 2026-10-22): Explorer $19.99 (1999 credits) and Champion $39.99 (3999) for 30 days, new Sovereign $99.99 (9999, 30 days) and Legend $249.99 (24999, 365 days, the yearly pass). One table (gamepass.js TIER_DEFS: rank, names, settings stem, defaults, member-card perks); settings gamePassSovereign*/gamePassLegend* with kill switches; flag()/partner player/hand-off token carry sovereign/legend; buy, waiting orders ($100/$250 package copy), extend from max(now, until), comp/revoke, admin By pass tier table and comp options; chatbot tier fact says coming soon while sovTiers is off. All behind sovTiers (still 0): weekly Game Pass price, length and caps unchanged. Tests: sov-passes store + local extended (all pass), member QA 0 bugs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 10:26:58 -05:00
martbost 4e51470cf5 Sponsor follow + one network holding tank + Sponsor check (Marty, 2026-10-22, approved 1-3)
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>
2026-10-22 09:05:07 -05:00
martbost 1e040f21ff Chat knowledge base: the assistant answers from maintained entries, and support replies become entries
- 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>
2026-10-20 05:37:09 -05:00
martbost 0688bdeb72 Pass tiers: Explorer ($20/30 days) and Champion ($40/30 days) beside the weekly Game Pass, behind sovTiers (default off, admin-only preview)
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>
2026-10-18 14:46:51 -05:00
martbost 34a1de0b15 P&L: Game payouts card, an all-time running total of every game wallet's payouts read from Polygon (incremental, cached); PolHunter ledger detail folded under it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 07:11:25 -05:00
martbost 017017ad63 Login ad in the games: the sponsor interstitial after a fresh in-game sign-in, counted per surface
- 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>
2026-10-18 06:17:41 -05:00
martbost af66f7f865 Help desk translation: member messages in other languages get an English translation (Telegram, admin email, admin view, bot thread); Marty's replies go back in the member's language with his English underneath (OpenRouter, reasoning off; failures fall back to untranslated)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 19:03:30 -05:00
martbost e2d15aa751 Support in the top nav of every public page, and the chat bubble's greeting points to support; cache tags bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 17:20:31 -05:00
martbost 9be58bd5ef Help desk: support tickets for members (Help pane), the public /support page with private ticket links, chatbot hand-off, and an admin Support pane
- 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>
2026-10-16 16:51:30 -05:00
martbost 4d6a0f2f83 Game Pass (IAP side): $5 weekly pass across all nine games + account-wide POL cap service
- 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>
2026-10-16 08:18:09 -05:00
martbost 7aec7d5169 Presentation page + Build Wide 'wide' join angle
- /presentation: the narrated InstantAdPay presentation (video on Spaces
  training/iap-presentation.mp4, poster .jpg), caption pills for
  en/it/fr/es/de/pt (VTTs served from /captions, text/vtt MIME added),
  sponsor card from /api/sponsor ("Shared with you by @name" + Join to
  /join/<ref>?v=wide, or the plain join link). Works framed: join and
  sign-in open a new tab, internal links carry ?ref.
- Site menu + footer: Presentation. Sitemap, Traffic pages and the viral
  page list include it. Promo tools: "Share the presentation" strip copies
  instantadpay.com/presentation?ref=<username>.
- 'wide' join angle (Width unlocks depth.): server JOIN_ANGLES with the
  buildwide poster as og:image, join.js angle (portrait video on phones,
  16:9 otherwise, files promo/buildwide*), link stats row, promo VIDEOS
  first entry with a per-entry file override, front-door list entry.
- Chatbot: presentation canned answer + facts, ?v=wide in the angle lists,
  KNOWLEDGE_DATE 2026-10-15.
- common.js/my.js/promo.js/join.js cache tags bumped; qa/walk.mjs PUBLIC
  gains /presentation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:51:04 -05:00
martbost f8e55413ee Mint passes survive deploys: durable persisted maps (passes, prizes, game orders) are restored whatever their age, pass records carry ts; the admin member card shows PolyWarriors mint passes
The open-tokens loader kept only entries newer than 2 hours, meant for short-lived earn tokens; pass balances had no ts, so every deploy wiped them (Orlando's were lost on 2026-10-10).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 09:51:06 -05:00
martbost 5c31f4540c Sign-in guard: measure form age on the visitor's own clock (fage) so a device with a fast clock is not refused forever
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 04:26:58 -05:00
martbost 98c24c2e6b Platform facts page (/facts) and /llms.txt: verified contract split, credits, refunds, anti-fraud and games; footer link on every page; sitemap entry
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:25:26 -05:00
martbost 8251c0e693 Broadcasts: a pop-up when sent (how many members) and when not sent (why); an expired sign-in keeps the draft and offers Sign in again (Brian 2026-10-05)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 11:57:06 -05:00
martbost 503a252fc8 P&L: Game marketing category for game wallet top-ups (old top-ups moved once from Player rewards); counted in Advertising and promotion
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 08:22:06 -05:00
martbost c99896c131 Member welcome offer from the games: starter.js (+100 purchased-grade credits on a first $5+ package after a game visit within 14 days, once per account; setting starterBonusCredits), /api/starter + /api/starter/public, /my?from=<game>#buy banner with the way back to the game perk, Members get <perk> on game cards, admin Traffic 'Games to members' table
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 06:26:03 -05:00
martbost eb3cfebf1f P&L: Cost lines with tax categories (advertising, player rewards, software, other), outside-wallet source, duplicate-tx guard; Tax summary (income vs advertising/promotion, own sales excluded, CSV)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 07:22:21 -05:00
martbost 3f758cdd38 Framed pages: the new tab's sign-in link carries the page's sponsor (?ref, /join/<tok>, /wall/<tok>)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:39:18 -05:00
martbost 563ece9896 Traffic exchanges: inside another site's frame, sign-in/join and off-site links open in a new tab (sign-in cookies are refused in frames)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 19:23:04 -05:00
martbost a5a991d024 Spooky Doors launch pack (IAP side): door packs + Golden Doors, Promo tools card, season from Oct 4
- Visit packs get a placement: 'all' (as before), 'doors' (Behind Spooky Doors, doorPackCost 4/door) or
  'golden' (Golden Spooky Door, goldenDoorCost 6/door). campaigns.placement column (alterSafe) + JSON store.
- Doors serve golden packs first, then door packs, then the existing chain; each pack at most once per
  player per Central day. Door-only packs never reach the Earn tab, refuels or the PassiveDrip listing
  until rates.sdSeasonEnd ('2026-11-01'); from then on they behave as 'all'.
- Door payloads: credits = per-door price actually charged (3/4/6); Golden Doors add golden: true and
  bonus: goldenBonusCandy (2) to /api/door/open, done, callback and receipt. Gold variant of /door.
- Campaign list: Spooky Doors / Golden Door chip, doors opened + unique players, Buy more doors at the
  door price. Composer: placement choice with live cost. Admin rates labels + house pack placement.
- Promo tools: Spooky Doors card (spookydoors.com/r/<username>, copy, share image, two posts) on the same
  season window as the Games card (seasonState helper).
- Season start moved up to 2026-10-04 (Games card + promo card + chatbot).
- qa/door.mjs covers all of the above.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:55:19 -05:00
martbost 9809953ae0 Spooky Doors house ads: an empty street serves one of Marty's programs instead of "Nobody's home"
When a door finds no visit pack and no video, /api/door/open serves a house ad from rates.doorHouseAds
(RM Circle, Drip Runner, Gem Kingdom, PolHunter by default; ref templates carry the player's IAP username
where the program takes a share link). Rotation: never the same program twice in a row, else the one least
recently shown to that member today. Same dwell + Halloween icon check. No advertiser charge and no campaign
imps, but it counts toward doorCapPerDay (visit_repeat row with campaign 0). Callback and receipt add
house: true and program, with credits 0, host null, campaignId 0. doorHouseAds = [] restores none=1.
Admin rates table keeps text columns as text so the list survives a save. qa/door.mjs covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:06:53 -05:00
martbost a7a15615ec Sponsor survives a lost cookie: join page sends its own token with the code request, server remembers it per email for 30 days, framed visitors offered a full window
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 09:48:06 -05:00
martbost ab2431be11 Email an update: release notes are optional when there is an intro
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 05:22:24 -05:00
martbost a9cffb87d4 Email an update: a refresh never re-ticks release notes; a saved draft decides which notes go
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 04:50:59 -05:00
martbost 927b13a7cf Admin > Email an update loads at once; audience counts fill in from the background
The panel waited on a Sendy pass over every member (minutes, and the cache
empties on each deploy), so it showed blank. Counts are now a snapshot with
a background refresh, and the form no longer depends on them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-28 04:43:42 -05:00
martbost 3f9dc3cc94 A session pop-up that says what InstantAdPay actually is
The dashboard card was too easy to scroll past, so this is a real overlay: once
per browser session, on every page that loads common.js, dismissed with the X,
Escape or the backdrop.

It leads with the mechanic rather than the promotion, because the ask was to
remind people what the site is about: the ad spend in your line pays you, in the
same transaction. Five Dollar Friday rides underneath as the reason to act, and
the copy is driven by the live /api/friday, so it reads "tomorrow", "today" or
nothing at all without anyone editing text on a Friday morning.

Not shown on /join or /admin: an overlay in the middle of signing up costs
sign-ups, and staff do not need reminding what the product is.

QA: the overlay appears after an async fetch, so hiding it at load time missed
it and every click in the harness timed out. The harness now pre-sets the same
sessionStorage flag a real dismissal uses, before page scripts run. Green again,
0 bugs.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-24 15:54:33 -05:00
martbost 6ff21f76ee P&L: account for money the chain cannot explain
The P&L took revenue from AdminPaid events and holdings from eth_getBalance,
so anything else moving through a receiver was invisible. Receiver A has earned
10,871.89 POL and holds 4,561.19; nothing explained the difference, and the gap
would have widened every time Marty drew from it. "Why would I ever keep a
receiver wallet that I never take anything out of? That's stupid, so I need to
be able to account for it."

Three kinds, because three different things move through that wallet and only
one is profit. Revenue is outside income, a ClickBaitPays withdrawal paid in
POL, and counts toward profit. A draw is house profit spent on something, such
as funding RM Circle #139's Culmen to Apex upgrade; it leaves the wallet but is
not a cost of running InstantAdPay. A transfer is Marty's own capital parked in
the Tangem receiver for safekeeping, and moves the balance only: counting it as
revenue would report his savings as earnings.

The pane now states earned, plus revenue, less draws, against what is actually
held, and names any unexplained drift rather than hiding it in a balance.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 18:10:56 -05:00
martbost 489d832546 Sign-in: stop telling a fast returning member off for being fast
The email-code endpoint refuses a request that arrives within two seconds of
the page loading, because a script fills a form instantly and a person does
not. A member whose email is already filled in by the browser has nothing to
type, taps straight away, and gets "Give the page a second, then tap again."

The page now waits out the remainder itself and sends when the window has
passed, so the person sees the normal sending state instead of an error.
The server check is untouched, so anything posting at the endpoint without a
page behind it still fails exactly as before.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 05:50:34 -05:00
martbost 286ac9207a Hand the sponsor to PolHunter, and put its payouts in the P&L
PolHunter now pays a bounty when a hunter brings someone who turns up and
hunts, and the person who gets it has to be the one that member actually
joined under here. The sign-in payload carries sponsorRef and the join date
across so PolHunter is never guessing from a cookie.

Its payouts are real POL from its own faucet and none of it passes through the
ad contract, so the P&L could not derive it. It now reads the figures across,
cached and fail-soft, and shows finds, bounties and matches as their own card.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-23 04:36:02 -05:00
martbost e95f9df13a Approved exceptions: people you have okayed to hold more than one account
Marty approves specific people for multiple accounts (partners, staff, a spouse on a
shared machine) and needed a way to say so without the guard fighting him.

Admin > Members > Duplicate signals now carries an "Approved exceptions" list: add an
email with a note, see who is on it and when, remove one. It sits directly under the
signals so the two are read together.

An exception can be added against the address they ALREADY have, not just the new one.
That matters because the usual case is approving a person before their second address
exists, and at sign-up time the new address is unknown to us. checkSignup now tracks
every account the sign-up collided with, and clears the block if either side is approved.

Clearing the HARD flags matters as much as clearing the block. Those flags are what
silently drop an account off the leaderboard and bar it from adopting out of the holding
tank, so an approved person would have been "allowed" in name only. They now keep both.
The account is tagged 'allowlisted' instead, so the admin sees why it went through, and
the server logs the exception by name.

Suspension still wins. An exception is permission to hold several accounts, not immunity
from being suspended for something else.

qa/fraud-allow.mjs (12 assertions) boots its own server and walks the real flow: first
account created, second blocked with the Qualified Start redirect, exception added,
second account now created, no hard flag left on it, exception visible in the admin
report, removing it blocks again, malformed address refused, endpoint admin-only.
qa/sponsor-note.mjs 5, qa/run.sh member 0 bugs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 10:42:31 -05:00
martbost 8ad2e01a74 Admin: a linked wallet can no longer be misread as an active position
The member card showed the wallet address on its own, directly above "Registered:
no (payouts off)". That reads as "he is set up" when he is not, and it caused a
real misread today on @mcbit1: wallet linked, memberId 0 on chain, every sale in
his line walking up to his sponsor while the row looked healthy.

Linking a wallet is a free signature that tells the site which address is theirs.
Switching on payouts is a separate transaction that creates the position. Only the
second one makes them payable, so the two states now say so:

  Main wallet  0x30a7…5703  payouts OFF
  Registered   no  wallet linked, but payouts were never switched on, so no
               position exists. Sales in their line walk up to their sponsor and
               lock there.

and the no-wallet case says "no wallet linked yet" instead of the same text.

qa/run.sh member: 0 bugs (the 2 warnings are pre-existing and unrelated).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 05:03:29 -05:00
martbost 34c62b9d3a Anti-fraud: one account per person enforced at sign-up (device cookie + IP), flags, admin duplicate signals, suspend switch
Marty, 2026-09-16, after @megamol created megamol2/megamol3 under his own link and bought $20 on each
to fake his two qualifying buyers. fraud.js records sign-up IP/UA/browser id (iap.dev cookie set with
the code request) and last-seen on sign-in. New accounts: dup-device (browser already has an account)
and sponsor-device are refused, ip-burst (> fraudMaxSignupsPerIpDay, default 2, per 24h) is refused;
sponsor-ip and shared-ip are flagged only. Flagged/suspended accounts never count on the leaderboard
and cannot adopt from the tank; suspended accounts are signed out everywhere (auth.fromRequest
wrapper) and refused at sign-in. Admin > Members: Duplicate signals card (shared browser / IP,
flagged, suspended), flags badge, Suspend/Unsuspend; GET /api/admin/fraud; PATCH members {suspend,
reason, flags}. Telegram admin alert on every block/flag. Privacy page + chatbot prompt updated.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:39:13 -05:00
martbost a727ab1ce5 Payment trace: self-serve "who was paid, who was skipped and why" per purchase (Earnings tab + admin member card)
Marty, 2026-09-16, after the third "why didn't my sponsor get paid" thread of the day (livedreams / gracie25,
Morten / Terry's linked wallets). GET /api/my/trace?who=<#|username> (yourself, anyone up to 3 levels
below you, or your own 3 uplines) and GET /api/admin/trace?who= list every purchase the member was
part of, newest first: buyer, sponsor, package, then levels 1-3 with the recipient, the skipped
positions and the reason ("not qualified: had N of 2 qualifying buyers then"), the platform share, and
a verify link. Linked extra wallets are named after their owner. Earnings tab card "Trace a payment";
admin member card gets a "Payment trace" section; chatbot canned answer + AI prompt route the
question there.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 12:24:53 -05:00
martbost dda8c976b0 No native dialogs: Shorts report prompt -> inline reason buttons; admin drip confirms -> IAP.confirmBox
Same class of bug as the campaign #27 false report: the Shorts report was a prompt() pre-filled with
'inappropriate'. Members now tap a reason button on purpose or cancel. Script tags bumped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 10:23:00 -05:00
martbost 616f328db5 Report-an-ad dialog: site dialog with no default reason (was a native prompt pre-filled with "broken")
Campaign #27 (house AdRevSplit text ad) was reported "broken" with no note while the target framed
and loaded fine; the report dialog was prompt() with 'broken' as the default value, so one stray OK
filed it. Now IAP.ask with an explicit, validated reason and an optional note; common.js tag bumped
on all pages.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 10:21:53 -05:00
martbost 84a9063bbe Admin > Reports: counters audit (views vs delivery logs, login days charged vs shown, featured views, clicks vs views, spend vs budget), daily with Telegram alert
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 05:32:13 -05:00
martbost 6e8f1ccf9d Member updates: closing text after the notes (sign-off placement)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 14:21:13 -05:00
martbost 14868753c0 Member updates: saved draft (loads into the admin card, Save draft button)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 14:11:51 -05:00
martbost 024170e7f8 Member updates: audience defaults to newsletter opt-ins (Sendy list status), explicit 'everyone' option; sendy.status()
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 13:47:13 -05:00
martbost 7bb956e896 Admin > Releases: email an update to members (pick notes, intro, audience, preview, test, send; opt-outs honoured; send log)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 13:40:01 -05:00
martbost 825d0de6c3 Header: Leaderboard link
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 05:40:26 -05:00
martbost b3523e9dc4 Release notes + roadmap: /whats-new page, Overview What's new card, Admin > Releases editor
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 04:54:43 -05:00