Commit Graph

115 Commits

Author SHA1 Message Date
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
martbost dd53d132d6 Games hub: one Games menu entry and pane with a card per game (registry in server.js, live list = site config gamesLive, default polhunter; admin sees unlaunched games as previews), Drip Runner card with the player's own progress via a signed read; chatbot knows Games + Drip Runner (KNOWLEDGE_DATE 2026-10-01); QA walk covers the pane
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 04:36:49 -05:00
martbost 37a78de339 Wired Wednesday: page, kit, chatbot and banners say $20 and up
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 08:10:48 -05:00
martbost 8a6029cd90 Wired Wednesday: bonus is wired into the balance (purchased-grade, any format), no forced visits campaign; all copy corrected
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 05:42:08 -05:00
martbost 04fd4db9ca Wired Wednesday: +25% on $10+ packs wired into a verified-visits campaign; /wednesday bridge page, banners, kit, cards, chatbot (notice + kickoff off until approved)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 04:49:34 -05:00
martbost d562d61cbc My line: how pay it forward actually works here, and a confirmation before every PIF
Wallet-to-wallet gift in good faith, unlike platforms that buy the position
out of an account balance. The site holds nothing, cannot reverse or recover
it, and nothing obliges the recipient to buy. Same wording in the chatbot.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-27 15:14:51 -05:00
martbost 5b694c8ab4 Five Dollar Friday bridge page, with the member's link on it
Marty's ask: use the Friday promo as a tool where the sponsor gets the
credit, and as a bridge-page entry point. The sponsor part already worked
(any public page + ?ref sets the sponsor cookie, 2026-09-21); what was
missing was a page that is ABOUT the offer, so a click on a "20% bonus
credits today" image did not land on the general pitch and leak.

/friday: the banner as the hero, the live state from /api/friday (live now
with today's pack count and bonus credits issued, or the next date with a
countdown to midnight Central found by scanning minutes so DST cannot put it
an hour out), three steps, the email-first join with a new `friday` angle so
it shows as its own row in Admin > Traffic, and the credit definition. No
attribution logic added: last touch, walk-up, as everywhere.

Promo tools: a {{FRIDAY}} token that turns the member's invite link into
/friday?ref=<username>; posts for X, Facebook and Telegram and a text that
carry it; the three new banners (loft 1200x630, dark 1200x630, square
1080x1080) as a group in the kit with a copy-my-Friday-link button on it.
Chatbot answer points at the page and drops the stale "first one is
September 25" line. /friday in the traffic list, the sitemap and the QA
public walk. Cache tags bumped on my.js, promo.js and site.css.

QA member walk: 0 bugs.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-25 06:26:11 -05:00
martbost e2f88dad42 Viral links: any public page + ?ref=<username|code|id> sets the same last-touch sponsor cookie as /join, counts under a 'page' hook in link stats, then redirects to the clean URL; Promo tools > Viral links builder (pages list + paste any address, copy + share); blog posts show a signed-in member's own link; chatbot answer; QA walk proves redirect + cookie
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-21 05:54:55 -05:00
martbost 68b08ab8cc Five Dollar Friday: +20% purchased-grade credits on any $5+ package bought on a Friday (Central), live wave on the landing strip and Overview card, Telegram every ten packs + Friday kickoff + midnight wrap-up, Thursday notice + email, Five Fridays badge, promo posts + swipe, chatbot; first Friday 2026-09-25
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 13:59:15 -05:00
Marty Bostick de5bdfefaf SocialPix gate: /from/socialpix bridge page (advertiser copy by default, ?seg=earn), chatbot knows the new page
socialpix.club was being used as a free ad board by posting bots; its signup/onboarding/post flows
now redirect here. No legacy credits for these arrivals. Referrer tagging (traffic.js) already covers /from/*.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-20 09:26:40 -05:00
martbost a85ee4cacf Login slots: 1,000 credits, at most 3 member slots live; viewer gets an open-in-tab link
Marty (2026-09-19): cap the login-ad slots. About 124 members sign in a day and every live
slot shares those views, so a fourth slot only thins the other three. Member slots only;
house login ads now step aside whenever a member slot is running (JSON: filtered out of the
pool; MySQL: ORDER BY house ASC). The 14 slots already running keep their term; new buys are
refused until one ends. Format label and chatbot updated.

mindfulmojo (email, 2026-09-19): the viewer frames the advertiser's page and both controls
meant "back"; some sites refuse to load inside a frame and signing up is easier in a full tab.
The viewer bar now carries "Open site in a new tab", set from the ad's target URL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-19 07:46:12 -05:00
martbost ccc372152d Sessions last 4 hours, and we say why
Marty's call. Sign-ins expired after 24 hours, which meant a member passed
the login gate roughly once a day — and that gate is the entire inventory
behind the login-ad product. The platform has served 356 login impressions
in its life while members have bought 20,526 credits of them.

Four hours, env-tunable via SESSION_TTL_HOURS.

Said out loud in three places rather than left to feel like a glitch:
the login gate itself now explains it, the chatbot has a canned answer for
"why do I keep getting logged out", and the same fact is in the assistant's
system prompt so the AI never calls it a bug. Wording throughout is
Marty's: to keep resources optimised we do not keep anyone signed in
longer than 4 hours, and nothing about the account, credits or line is
affected.

The canned pattern was checked against the neighbours it sits beside —
seven phrasings reach it, and withdraw / pyramid / earnings / second
account / payout answers are all untouched. CANNED is first-match-wins,
so that check matters.

Member walk clean, chatbot suite 35 green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 13:31:52 -05:00
martbost f27388a322 Chatbot: catch the PIF question when nobody says "PIF", and stop inventing references
Follow-on to the risk rewrite. Two gaps it exposed.

Members ask this without the word PIF: "should I fund their first package", "can I
buy it for them", "can I front someone the $20". Those were falling through to the
AI, which answered reasonably but told the member to "read the full warning on your
training page" - a page section that does not exist and that they would go looking
for. The pattern now also matches a paying verb plus an explicit for-someone-else
phrase, so these get the full canned answer with the risk in it. It deliberately
needs BOTH halves: "which package should I buy" must not be stolen.

The prompt now forbids sending anyone to a warning, guide or page section that is
not in the PAGES list, and requires plain ASCII (the model was emitting non-breaking
hyphens in "Wi-Fi").

Fixed two first-match-wins routing bugs, one of them mine from the previous commit:
"what do I get for buying a package" was returning the commission split, because I
had widened the earnings pattern to "what do I get" when it should only ever have
been "what do I get paid". And "should I buy the $20 package" previously matched
nothing at all and burned an AI call on a question we have a written answer for.

CANNED is an ordered list, so any pattern edit can silently steal a neighbour. The
suite now pins a 19-case routing table across PIF, price, earnings and the tank, so
the next person to widen a regex finds out immediately. qa/chatbot-parse.mjs is 35
assertions. qa/run.sh member: 0 bugs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 05:41:54 -05:00
martbost 3867b28bd4 Chatbot: the PIF risk is the answer, not a footnote
Marty: the answer has to cover what a member is risking when they send POL to
somebody they have not spoken to and have no commitment from.

The canned answer now leads the advice with "do not send anything until you have
actually talked to that person and they have told you they will use it", then says
plainly: the transfer is wallet to wallet and irreversible, there is no refund and
no chargeback, support cannot pull it back, the gift is theirs whatever they do with
it, and they are free to go quiet or spend it on something else without breaking any
rule. It names the worst case for what it is, which is that a tank member joined
with nobody working with them and may never have engaged, so an unanswered PIF is
the easiest money on this site to lose.

It gives the arithmetic both ways rather than only the upside: a gift that works
costs about half, because the contract pays the sponsor 50 percent when they buy;
a gift to someone who never answers costs all of it. It ends on never gift money
you need and never borrow to do it.

The same guidance goes into the AI prompt as a standing rule, so PIF is never sold
as a tactic on any phrasing that misses the canned pattern, and a "should I PIF
someone from the tank" question starts with talk to them first, not the mechanics.

qa/chatbot-parse.mjs is now 16 assertions: the 9 response-shape cases plus 7 that
pin each risk line, so a future rewrite cannot quietly drop them.
qa/run.sh member: 0 bugs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 05:36:42 -05:00
martbost 6c8cc0ede2 Chatbot: the PIF and holding-tank answers, and no more dead ends on a provider hiccup
Marty hit "I hit a snag answering that one" on "Should I pif someone from the
holding tank". Two separate problems behind it.

The real bug: OpenRouter pads a slow upstream with keepalive lines before the JSON,
and when the provider gives up it can close having sent ONLY that padding. HTTP 200,
no body. JSON.parse threw and EVERY non-canned question died the same way, not just
this one. Now we find the actual JSON object in the stream, treat an empty answer as
a failure rather than sending a blank reply, retry once (the usual cause is one
provider dropping the request), and if both attempts fail we say plainly that it was
our side, not their question, and point at a person.

The content gap: PIF and the holding tank were in the system prompt but had no canned
answers, so they depended on the AI being up. Both are now canned and instant. The PIF
answer leads with the thing the question gets wrong, which is that you cannot PIF
somebody still in the tank: adopt first, they link a wallet, then the button appears.
It is honest that nothing obliges them to buy, that crypto transfers are irreversible,
and that the 50 percent coming back only happens if they actually purchase.

Also fixes a pre-existing routing bug found while testing: "how much do I earn"
returned the PACKAGE PRICE ladder, because the price pattern matches "how much do"
and the commission pattern only caught "how much earn".

qa/chatbot-parse.mjs (9 assertions) drives the real parse branch against a stub
server for every response shape: keepalive-only, keepalive-then-JSON, plain JSON,
SSE comments, empty content, non-JSON. qa/run.sh member: 0 bugs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 05:27:18 -05:00
martbost a2cea3a2be Anti-fraud refusals redirect to Qualified Start (the sanctioned way to hold extra positions); chatbot says the same
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:52:46 -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 125be174e3 Terms: one account per person (duplicate accounts and self-referral prohibited; Qualified Start linked wallets are the only sanctioned extra positions); chatbot canned + prompt
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:29:54 -05:00
martbost 9b3a79561b Chatbot: repair the price pattern (shell had turned \b into backspace bytes), full package ladder in the answer, ranked above the credits answer
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:19:17 -05:00
martbost 2b4050d410 Chatbot: exact page map (no invented URLs), tighter price/credit patterns, canned answer for the unactivated-sponsor walk-up
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:14:37 -05:00
martbost 27f2742c31 Chatbot: banner-image questions get the creative rule, not the Promo tools kit answer
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:12:49 -05:00
martbost 362526d007 Chatbot brought fully current + knowledge guard
Audit against the live site: removed stale text (featured links and visit packs marked "coming",
Pipeline "coming soon", the superseded sponsor-hold rule, a non-existent home-page calculator,
"earned credits spend on banner and text only", "Coaching pane"); added live featured and visit-pack
rules with prices and limits, the video cap and rewards, the sign-in bonus and claim ladders,
report-an-ad, the public missed-payout posts, the walk-up gain notice, the four-minute overview
video, the promo Videos and Toolkit tabs; new canned answers for featured links, visit packs and
"what is this". KNOWLEDGE_DATE constant + qa/chatbot-sync.mjs (run in public/all QA) fails when a
release note is newer than the chatbot's knowledge.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 14:10:00 -05:00
martbost 5641582709 Banner creatives must be images: server-side image check (extension or image/* HEAD), form hint, chatbot note
Campaign #134 (NAS ad 2806) had the member's join-page link in the image field and served a broken
banner 141 times on the network; #102 did the same with an imgbb page link. imageCheck() accepts
/uploads/ and instantadpay.com/banners files and image extensions outright, otherwise HEADs the URL
(one redirect) and requires image/*. Wired into member and house campaign creation for banners and
login-ad creatives. Form placeholder + hint point at Promo tools > Banners > Copy image URL.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 13:56:30 -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 dffcaa113b Never hold a sale for an unactivated sponsor: walk up to the first payable upline, referral follows the money
Marty, 2026-09-16: a purchase must never wait on a sponsor who has not linked a wallet / switched on
payouts. /api/sponsor and /me now walk the site's sponsor line upward to the first upline that is
activated with payouts on (not on the no-payout list) and the buy proceeds under them; nobody
activated -> the catch position (#1). The buyer sees a one-line notice and carries on; admin gets a
heads-up. When the position is created on-chain (MemberActivated), sponsorSyncOnEvent re-points the
buyer's stored sponsor to whoever was paid (#1 included), so the referral leaves the skipped
sponsor's line for good, then sends the pointed notices: the skipped sponsor(s) are told they lost
this referral permanently and how to switch on payouts; the sponsor who was paid is told the
referral is theirs for good and to coach the one who missed it (teach-forward). Admin lookup:
GET /api/admin/sponsor-resolve?ref=. Only a transient chain error still pauses a buy.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-16 11:18:14 -05:00