Commit Graph

139 Commits

Author SHA1 Message Date
martbost e5c55c2d8b Never hold a purchase (Marty 2026-10-27): a holding-tank buyer with no sponsor anywhere goes ahead under the catch position #1; the 24h hold only stops a plain switch-on-payouts. Network alignment still runs first. home.js buys with intent=buy; chatbot + QA updated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:05:06 -05:00
martbost 4645d5605a Holding tank activation hold (Marty approved 2026-10-27, "hold them for no longer than 24 hours"): a tank member is never bound under the fallback #1
- Align first: a tank member whose email or wallet already has a sponsor on LinkSpin (the inbound registry rows) is placed under that sponsor when they have a real account here, never a sponsor they were released/rescued from, never a loop (recorded in tank-ready.json, shown in Admin tank)
- Hold: /api/me and /api/sponsor answer tankHold {since, until} instead of the fallback sponsor; Wallet tab hides Activate payouts and shows "You're being matched with a sponsor..." with time left, Getting started has no activate button, buy flows (my + home) refuse on tankHold. The 24-hour clock starts when the member is first seen with a wallet linked (already-linked members start at deploy)
- Surface: Ready to activate badge + hours left, ready members on top (My line tank, Admin tank, Overview notice count); one Telegram line per newly ready member (digest when more than 3, e.g. the first tick after deploy)
- Safety net (readyTick every 15 min + hourly sweep): unadopted 24 h after readyAt -> next eligible adopter in rotation (own $20+ buy, fewer than 2 open, signed in within 7 days, not suspended/flagged, not company, not a no-payout chain, not in their own downline; least recently auto-assigned first, ties by earliest qualification) through adopt() with "auto-assigned after 24 hours in the tank", chat + email to both, Telegram pickup "(auto-assigned)". Nobody eligible: keep holding, one admin alert
- tank.eligibility is now exported (the Overview tank notice was silently failing on it)
- Chatbot: tank-hold canned answer, holding-tank answer + system prompt updated, KNOWLEDGE_DATE 2026-10-27
- qa/tank-hold.mjs (mocked clock unit + local copy e2e), wired into run.sh member and run.sh tankhold; cache tags bumped

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 06:03:41 -05:00
martbost fc81c6a4db Chatbot: free game caps started 2026-10-26 (Marty moved capsStartDate up from 10-29)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 17:13:22 -05:00
martbost 06f0a87452 Conversion tracking fixes (Marty approved 2026-10-26): real test pixel, own-click count, own-browser clicks as tests, cost per goal (30 days)
1. Own clicks: auth.onSeen notes the soft key of every InstantAdPay session (lsconv.noteSession, once per 6 h per email + soft key) and the click push carries them as owners [{owner, sk, ts}] (requeued on a failed push), so LinkSpin keeps members' own clicks on their ads, spin links and Banner Spins as tests. /api/ads/click flags a click self for conversions when signed in as the owner OR from a browser the owner signs in from; whether the click is counted and billed is unchanged (still the signed-in check). Linked positions share the owner's email.
2. Send a test conversion now loads the member's real LinkSpin pixel in test mode from the browser (cv.gif?px=..&test=1, reads X-LS-Result: test, the same request LinkSpin's button makes) and falls back to the signed partner call (op test) when the browser cannot load it; CSP connect-src adds https://linkspin.app. The card shows "N from your own clicks, kept as tests and left out" (selfTests from LinkSpin's summary).
4. Cost per goal (30 days): /api/my/conversions returns spend30 = each campaign's spend over the same 30 days from credit_log (ads.spendSince: delivery, login, buy, refund rows by Central day, ref = campaign id). Campaign lines read "Goals and cost per goal (30 days)"; a campaign started inside the window with no log rows uses its spend since start (labelled in the tooltip); an older campaign with no spend on record shows no cost rather than a lifetime figure.
Copy: Conversion tracking card note, /conversion-tracking (test button, own clicks, cost per goal (30 days) row). Chatbot CANNED + FACTS, KNOWLEDGE_DATE 2026-10-26. my.js ?v=20261026cv.
QA: convpixel all passed (new: owners pushed without raw IP, own-browser click self=1 and stranger 0, no re-push within 6 h, spend30 = 200 of the window with the 40-day-old row and another member left out, 50/200 credits each vs lifetime 75, no-log old campaign shows no cost, new campaign uses spend since start, own-click count on the card, test button loads cv.gif?px&test=1 in the browser (routed locally) and falls back to op test); fuel all pass (engine.js / engine-room.js / kit.js untouched, byte-identical with LinkSpin); member walk 0 bugs; public 0 bugs (known /shorts ellipsis warning).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 06:31:18 -05:00
martbost b239417cc5 Game Pass tier prices = InstantAdPay one-click packages (Marty 2026-10-25): Explorer $20 (was 19.99), Champion $50 (was 39.99), Sovereign $100 (was 99.99), Legend $250 (was 249.99); weekly $5 unchanged. TIER_DEFS and the siteConfig defaults in cents 2000/5000/10000/25000, so the cheapest qualifying package is exactly the pass price (no silent overpay). A pass is still paid by one fresh package of at least the tier price. Member Games card: each tier says it comes with the $X package and its ad credits (my.js ?v=20261025pr). Admin Game Pass note, docs/GAME-PASS.md, chatbot tier fact (price = package, member keeps the package credits; still 'coming soon' while sovTiers is off). sovTiers untouched (0). QA: sov-passes-store + sov-passes-local ALL PASS with the new prices; qa member 0 bugs, qa public 0 bugs; qa/gamepass.mjs 2 date-based fails identical on the previous commit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 13:14:29 -05:00
martbost 47638ac1fe Fuel flow IAP -> LinkSpin made obvious (Marty 2026-10-25: "I clicked set up conversion tracking, it took me to LinkSpin and I don't know how to pick up from there"). Engine Room links now follow the site the member is on (engine.js build({site})): Set up conversion tracking on InstantAdPay opens /my#conversions (Campaigns > Conversion tracking card, scrolled to, highlighted, goal box focused; same goals LinkSpin counts) with the /conversion-tracking guide beside the button; buy/refuel/top-up and the Fuel part stay on this site. Only LinkSpin-only tools cross over (Banner Spin -> /links#b, spin link, page, testing), labelled "on LinkSpin" and tagged ?from=iap&task=<job> so LinkSpin shows an arrival strip with Step 1. Streak line and Refuel card get a "Refuel LinkSpin" link to linkspin.app/credits#refuel when the second engine is still open. Part labels wrap cleanly. Chatbot canned + prompt routes, KNOWLEDGE_DATE 2026-10-25. engine.js / engine-room.js stay byte-identical with LinkSpin. QA: fuel 12/12 engine incl. new site-links test, member walk 0 bugs. my.js, fuel.js, engine-room.js ?v=20261025ff.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-25 09:05:53 -05:00
martbost bf5cf62caf Conversion tracking member guide at /conversion-tracking (Marty, 2026-10-24: no training existed for the conversion pixel, live since 10-23)
Why track, the click -> landing page -> thank-you page -> counted flow drawn in HTML/CSS (across on desktop, down at 390 px), the 4 steps (goal, landing tag, goal pixel, test incl. the &test=1 page check), copy-paste examples with placeholders for plain HTML, WordPress (footer plugin + Custom HTML block), page builders and Aweber/GetResponse custom thank-you pages, what to do without code on the thank-you page (image pixel = cookie / 24-hour match, hidden lsclk field, LinkSpin.goal for pop-up forms), how to read the report (cost per goal in credits, match methods, tests, 30-day window, own clicks) and a troubleshooting checklist. Copy buttons in conversion-guide.js; frames handled by common.js.
Route + TRAFFIC_PAGES + sitemap + viral-link page list. "How to set it up" link on Campaigns > Conversion tracking. Chatbot CANNED conversion-tracking answer + FACTS line point to the guide (KNOWLEDGE_DATE stays 2026-10-24).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 10:18:51 -05:00
martbost 5802fd9835 Chatbot: 'How does the refuel streak work?' answered with the Games entry (its fast-path regex claimed any 'refuel'); games-tab now matches game refuels only (Drip Runner, refuel in the game), Monthly Refuel questions (refuel streak/day/bonus/window/kit, my/monthly refuel) reach the refuel answer that links /refuel. Seed refresh updates the live KB on deploy.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:14:49 -05:00
martbost 1b77825256 Fuel Your Offers member guide at /refuel (Marty, 2026-10-24): the flow drawn in HTML/CSS (works at 390 px), the numbers, the member route, misses, what counts, leader coaching and FAQ, restyled to the site, hero banners/fuel-your-offers-1200x675.jpg as og:image. /refuel without ?t= serves the guide; the games' signed /refuel?t=<token> visit page is unchanged. Added to TRAFFIC_PAGES (game visits with ?t= not counted), the sitemap and the viral-link page list. "How the Refuel streak works" link on the Refuel card (fuel.js) and in the Engine Room (engine-room.js, same file as LinkSpin's).
Engine Room fix: the streak line said "Refuel the other site this cycle" after BOTH sites were refueled; engine.js streakNote() now says "Both engines fueled this cycle: +X% on each", names the other site when only one is done, and quotes next rates when the window is open (test added, 11/11).
Chatbot: CANNED refuel answer + refuelFact point to /refuel, say either site alone keeps the streak, and describe the Pit Stop exactly as refuel.js decides it (another package on a site already refueled this cycle before the window; the other site's first package is the second engine). my.js tags: fuel.js + engine-room.js ?v=20261024rg.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 08:07:30 -05:00
martbost 8ecef442a1 Refuel: final badge art (Engine Started, Refueled 3/6/12, kie.ai, ribbon heights measured) + month-4 Twin Engine Featured bonus is 100 credits (was one Featured day = 40), Marty 2026-10-24; chatbot + test updated; my.js?v=20261024bd
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 06:38:58 -05:00
martbost 6b3cdaaa70 Chatbot: Level 4 override is live (CANNED level4-override + FACTS line; start Mon 2026-10-26 00:00 CT, first payout Mon 2026-11-02 9 AM CT). overrideMode=live + overrideGoLive=1792990800000 set on the site, payer wallet funded (Marty, 2026-10-24).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 06:14:57 -05:00
martbost 15f5374fac Engine Room (Fuel Your Offers stage 4, Marty approved 2026-10-24): a new Members tab (engineNav, pane-engine) on InstantAdPay, shown only while refuelStreak is on, unlocked by the first counted refuel and greyed with one move "Refuel to start your engine" before. engine.js (the same file ships in LinkSpin): facts() gathers one site's member facts (credits free + in campaigns, recent campaigns, clicks this week and last week from click_sources via coach.clicksSince, free login slots; on LinkSpin also goals this month from the conversion pixel counted from the Central-time 1st, and the Banner Spin / spin link / page / testing parts), build() turns both sites' facts + the streak into three plain dials (fuel left vs this cycle's refuel credits incl. bonus with days left at the recent burn; clicks this week against last week with clicks per 1,000 credits; goals this month vs a member-set goal stored with the streak, refuel.setGoal), the streak panel, warning lights (ads at 80%, ads out, refuel day coming, login slot open), six part lights (fuel, banner spin, spin link, page, testing, conversion tracking: green / amber / grey with setup links) and one next move from simple ordered rules (refuel window, relaunch, Pit Stop top-up, top up the winner, tracking, Banner Spin, test A/B, cut the loser, keep running). LinkSpin facts arrive through signed /api/partner/engine (cached a minute; LinkSpin down = unknown, never zero); InstantAdPay answers the same call for LinkSpin's panel with its facts + the streak. Member /api/my/engine, /api/my/engine/goal; partner op refuel/goal. engine-room.js (same file both sites): plain SVG dials with aria labels, works at 390 px, colour only for warnings. Chatbot CANNED + FACTS cover the Engine Room. my.js?v=20261024er (PANES + engine), engine-room.js?v=20261024er. qa/refuel-engine.test.cjs 10 checks (switch, locked, each dial, lights, parts, next-move order, facts on stubbed LinkSpin incl. Central month start, goal storage).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:55:02 -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 6cc868d10a Monthly Refuel streak (Fuel Your Offers stage 2, Marty approved 2026-10-24), InstantAdPay = source of truth for ONE streak per member across InstantAdPay + LinkSpin. refuel.js: counted refuel = a new $20+ package here (refuelMinIapCents) or $25+ on LinkSpin (reported by LinkSpin) by one of the member's own positions (main or linked); the first sets the refuel day, next due 30 Central days after the last counted refuel, window opens 5 days before, 5-day grace, one free miss per 365 days, else reset. Bonus = purchased-grade credits on the site where bought, credit log kind bonus "Refuel streak month k": one engine 10/15/20/25%, both engines in the same cycle 15/20/30/40% (second site gets the both rate, the first is topped up by the difference), m4+ both = one free Featured day credited (featuredPerDay). Stacks on Friday/Wednesday (separate grants). Pit Stop = half the current rate, once per site per cycle, not a refuel. Badges Engine Started (first refuel) + Refueled 3/6/12 months through postBadgeOnce (placeholder gauge art in public/badges/badge-refuel*.jpg; shown in the strip only once earned). Feed: one line per counted refuel to the payments topic (claim rffeed:<tx>, never a Pit Stop) + Monday roundup after 9 AM CT (claim rfweek:<monday>, skipped at 0). Reminders 5 days before / on the day / last call (email with unsubscribe + notice kind notice) from the site of the last counted refuel. Optional Refuel Day on the 1st (refuelDayPromo, default off). Every decision is made under a member lock (db.withLock: MySQL GET_LOCK across app copies) and stored by tx; every grant is an outbox row keyed by a unique ref and claimed rfg:<ref> before it is applied, so two copies never double-grant. Partner endpoints /api/partner/refuel/purchase|outbox|ack|status (HMAC LS_SYNC_SECRET), member /api/my/refuel, admin /api/admin/refuel (+ /tick, /member). Refuel card on the Overview (fuel.js). Chatbot CANNED + FACTS follow the switch (off: "built, not switched on"), KNOWLEDGE_DATE 2026-10-24. MASTER SWITCH refuelStreak default '0': nothing counted or granted, no reminders, no feed lines, card hidden. qa/refuel.test.cjs 19 checks (switch, ladder, both-engine top-up, grace, free miss incl. 365-day return, Pit Stop once, stacking, idempotency, two concurrent workers, Central day + DST, Refuel Day, badges, reminders, roundup, view). my.js?v=20261024rf, fuel.js?v=20261024rf.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:28:49 -05:00
martbost 42a1cce2f1 Conversion tracking copy: chatbot CANNED answer + FACTS line, KB FAQ entry for Aweber/GetResponse thank-you pages, home page FAQ question, privacy page section on the click id, landing tag and goal pixel
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:01:09 -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 87a45169d0 Five Dollar Friday copy: chatbot canned answer + FACTS and the /friday page mention the free 7-day Game Pass perk
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 08:15:44 -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 610f47c625 Chatbot: login-ad slots now 6 (raised from 3, Marty 2026-10-23); KNOWLEDGE_DATE 2026-10-23
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:34:29 -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 06b0924651 Restore LF line endings in badge.js, chatbot.js and my.js (the Game Pass commit 1c29285 rewrote them as CRLF from a Windows text-mode edit; no content change)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:25:02 -05:00
martbost 1c2928553a Game Pass: what you get, game by game (Marty, 2026-10-22: members must see what they are buying). The Game Pass card lists the account-wide caps, the weekly Pass Tournament, the badge, and each of the nine games' perks; new gold Game Pass achievement badge (badge-gamepass.jpg, name on the ribbon at 0.84) unlocked once a member has ever held a pass, shareable and postable like the others; chatbot canned answer + prompt carry the per-game perks and the 2026-10-29 free-cap date, KNOWLEDGE_DATE 2026-10-22; my.js cache tag bumped. QA member walk 0 bugs; qa/gamepass.mjs 2 date-based tournament expectations fail with or without this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 07:40:42 -05:00
martbost 8b1395a90c Chatbot: replies never carry an em dash (scrubbed to a comma)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:57:31 -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 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 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 f0c868ef23 Leader tools: Training section (Leader's Guide PDF, presentation, build-wide video) with cards in My line and Pipeline; #training?g=leader deep link; training entries can name their button; chatbot knows it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 14:09:55 -05:00
martbost 4c470d8e3c Packages: Starter $10 (1,000 credits) and Elite $500 (70,000) across tiles, calculators, promo copy, kits, facts, chatbot; tiles sorted by price; cache tags bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 12:16:45 -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 d0cc45eadb AI calls: reasoning off (deepseek-v4-flash began thinking by default and used the whole max_tokens, so chatbot and Copy Engine answers came back empty)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 05:30:23 -05:00
martbost bb11f8183d Chatbot: Road Agent (live 10-15) and its fuel-stop visits, from today's two release notes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 14:52:50 -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 7a79b4a930 Chatbot: fix a broken string in the PolyBreak answer (crashed startup; Coolify rolled back)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:32:37 -05:00
martbost c43f166418 Chatbot: PolyBreak canned answer + facts, Games roster, KNOWLEDGE_DATE 2026-10-13
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 12:15:46 -05:00
martbost a63f6206a3 Chatbot: fix PolyWarriors regex word boundaries (backspace bytes from the heredoc)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:05:33 -05:00
martbost 10617df866 Chatbot: PolyWarriors + SpellWheel canned answers and facts, Games tab roster, /games page, KNOWLEDGE_DATE 2026-10-12
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:02:31 -05:00
martbost 84d54eda16 Games page in Promo tools (All games entry with the member's referral, three posts), in the viral-link page list and the chatbot; a generic games banner (1200x630 + 1080 square) as the /games share image instead of the two-games launch art (Marty 2026-10-10)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 14:18:55 -05:00
martbost 28b90dcae4 Chatbot knows the Platform facts page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 15:31:05 -05:00
martbost 376a4b04f2 Chatbot: ClutterHunt pays POL now (fixed per-room rewards, no caps, no promises)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 08:38:40 -05:00
martbost 1932b625ac Chatbot: ClutterHunt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 17:11:47 -05:00
martbost 067460c0e6 Chatbot: Gem Kingdom free revive, Hero Bundle, Kingdom Pass, hero looks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 16:10:04 -05:00
martbost 8f61d11d43 Chatbot: PassiveDrip is live on the Earn tab for every member (canned answer + prompt facts)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:51:04 -05:00
martbost 2c2d93b2dc Chatbot: empty doors now show a house ad (smaller treat), not Nobody's home
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 15:57:11 -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 27c9d51fde Spooky Doors (Halloween season game): hand-off, door visits, costume shop, seasonal Games card
- SD_SSO_SECRET / SD_URL (default https://spookydoors.com); sdMint/sdOpen same token shape as Drip Runner
- GET /api/my/spookydoors sign-in hand-off (?ref pass-through; iap.return spookydoors + sdshop whitelisted)
- /door page (Halloween copy of /refuel, door art backdrop) + /api/door/open|challenge|done as visit kind 'door';
  signed callback to SD_URL/api/door/callback (X-SD-Ts/X-SD-Sig) + 24 h door-receipt on ret&ok=1&r=;
  ret&none=1 when nothing to serve, ret&cap=1 at the daily cap; host = campaign owner's username
- /sd/shop (+ topup/resume/confirm) costume checkout via ads.gamePurchase('Spooky Doors: <label>'), sd-receipt
- Games tab: generic season window (Central days, admin preview before start, hidden after end) + pink
  limited-time ribbon; progress from SD_URL/api/partner/player (signed); my.js ?v bumped
- Chatbot canned answer + prompt facts; qa/door.mjs (bash qa/run.sh door) end-to-end on a throwaway local copy

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 09:40:08 -05:00
martbost 0414560ecb chatbot.js: restore CRLF line endings
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:58:50 -05:00
martbost 9212128b0d Chatbot + Games card: Gem Kingdom pays POL for first clears (six chapters, boss ladder to 10 POL, pool-funded, no referral bonus)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 07:58:39 -05:00
martbost da7e421daf Chatbot: Gem Kingdom is live in the Games tab (pays no POL; Crowns bought with ad credits); the Games tab no longer says every game pays POL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 06:43:23 -05:00
martbost f56f363090 Chatbot: Drip Runner is live at driprunner.app
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 09:38:53 -05:00