Commit Graph

40 Commits

Author SHA1 Message Date
martbost a630979a3a Network sites as LinkSpin traffic sources (Marty 2026-11-14: "Make sure each of these sites is its own traffic source and link spun so we can track it"). Catalog: InstantAdPay, LinkSpin, Stack POL, Earners Corner network templates (next to Downline Banners and Viral Banner Blitz). A spin-link click with ?src=<site id> (iap, linkspin, dlb, vbb, stackpol, earnerscorner) counts under the link owner's source for that site, made from the template on first use (network templates only, no postback, so no network hears of a click it did not send; no referrer = the site's name as referrer). netlinks.js: at boot the admin account gets one fixed network link per site, made once when missing: nwiap, nwls, nwdlb, nwvbb, nwsp, nwec -> https://<site>/{s2}?ref={s1} (Earners Corner without ref), so every site links to the others as linkspin.app/r/<code>?src=<sender>&s1=<member>&s2=<page>. Health checks probe a destination with its {macros} empty, as a click with no params lands. netsites.js: /api/network-sites adds go (the tracked link with ?src=linkspin); common.js + netline.js footers use it (rel nofollow). common.js?v=20261114ns, netline.js?v=20261114ns. qa: netsrc 16/16 (new, bash qa/run.sh netsrc), member 57 passed 0 failed, partner-spins 13/13, netconv 57/57, lsid 31/31
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 11:39:34 -06:00
martbost f1f757f895 Footer: 'Part of the network' line from the network hub (Marty 2026-11-14 trust pack), smallest change before the 11-15 launch. netsites.js serves GET /api/network-sites (hub GET /v1/network-sites, 10 min cache, never waits on a slow hub, built-in fallback); common.js paints the line (LinkSpin marked as current) in the site footer and the members-area footer; company line TrustClickz, 615 Green Valley Drive, Moody, AL 35004; Earnings Disclaimer label; members-area footer links Support, Terms, Earnings Disclaimer, Privacy. common.js?v=20261114nf. qa member: 57 passed, 0 failed
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 10:22:33 -06:00
martbost c79b0aedf6 Network links (Marty 2026-11-13 'yes please proceed'): every click on a link to the other site goes through /go/<peer> (InstantAdPay -> /go/linkspin, LinkSpin -> /go/iap), so a signed-in member arrives signed in; signed out it is a plain redirect. Click-time rewrite in the shared scripts (IAP common.js; LinkSpin common.js + cr-shell.js), so copied share links stay clean; data-nogo opts a link out. Browser check: path+query+hash kept, other hosts and data-nogo untouched. iap-qa member ALL PASSED. common.js/cr-shell.js ?v=20261113nl
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 05:28:15 -06:00
martbost 7c4c9563fe Text ads get their own off-site rate (Marty 2026-11-12, same as InstantAdPay): Network Ad Space and partner-zone text views cost 1/synRateDivisorText (default 10, 1 credit = 100 network views) of the on-site rate; banners keep synRateDivisor 4. Going forward only. Admin Rates field, Ads screen + Campaigns table show 1/N per type, chatbot canned + prompt updated (KNOWLEDGE_DATE 2026-11-12). my.js/ads-screen.js/admin.js ?v=20261112txt
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 09:33:08 -06:00
martbost 01ef4e9260 Holding tank: 24-hour sign-up grace plus a Who invited you box, the same rules as InstantAdPay (Marty 2026-11-07: "24-hour grace plus the prompt"). One network tank, so both sites behave the same.
Grace: for 24 hours from an account's created time nobody can adopt the person by hand: an Opens in badge, no Adopt button, a plain refusal from adopt(). Auto-assign keeps its clock from the wallet link, so the 24-hour hold is not stretched. The wallet-ready post waits for the grace and says the time really left, is skipped when the rotation takes them in that tick, the arrivals post moves to when the grace ends (marks.claim per member), and the Overview note and weekly email count only people who are open.

Prompt: LinkSpin members land on the Control Room, not the /tools Overview, so the box sits at the top of every Control Room screen, /tools included (cr-shell.js). Same checks as InstantAdPay, through setSponsor as a deliberate change with by 'invited', so it follows and clears the hold. With a wallet already linked the engine switches payouts on under the named sponsor right away, as an adoption does, and the confirm box says so first. Nobody invited me hides it everywhere and a small link on /tools brings it back. The named sponsor gets the referral email and an on-site notice (new hooks.notify).

Chatbot canned + systemPrompt, KNOWLEDGE_DATE 2026-11-07. cr-shell.js, common.js, credits-screen.js, my.js, admin.js, admin-sponsorcheck.js ?v=20261107tg. qa/tank-hold.test.mjs and qa/sponsorfollow.test.cjs extended; qa/run.sh member now runs tank-hold.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 07:06:44 -06:00
martbost b59b6eb017 Update emails can be intro-only (LinkSpin launch campaign 2026-11-05): send() and the admin card required at least one release note; campaign emails carry only an intro and closing. Now an intro OR a note is enough. admin.js?v=20261105ue
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 18:47:54 -06:00
martbost f41d1ef384 Launch week: Founder badge + launch week contest (Marty approved 2026-11-05, PLAN.md options B and C)
Founder badge (cosmetic only: no credits, no POL, no perks, never posted to Telegram)
- Criterion: the account's earliest signed-in visit is before the launch moment (launchAt, default
  2026-11-15T06:00:00-06:00). Field: accounts.firstSeen, else lastSeen. Both are written only by
  accounts.touchSeen() on signed-in requests (dashboard, ping, chat); touchSeen now keeps firstSeen =
  the previous lastSeen on the next visit, so a pre-launch member who signs in again after launch still
  qualifies. Carried-over shells that never signed in have neither field and never qualify.
- Stored flag accounts.founder (JSON + MySQL column). Grant: launchweek.tick every 10 minutes from the
  launch moment, idempotent, one run per 10-minute slot across app copies (marks.claim); founderGrant '0'
  turns it off. Admin preview + "Grant Founder badges now" (refused before launch).
- Shown in the badge strip (on the way before launch, Share works, no Telegram post), wall (wall-founder.js),
  Team rows (my.js + team.js), the Team activity chip, and next to names on /leaderboard. Art:
  /badges/badge-founder.jpg, drawn in code in the existing card layout.

Launch week contest
- Window [launchContestStart or launchAt, launchContestEnd) = Sun Nov 15 6:00 AM to the end of Sat Nov 21,
  Central (end stored exclusive, 2026-11-22T00:00:00-06:00). Count = the weekly board's tier-1 TierPaid
  sales. Never counted: own positions, buys by linked positions (Qualified Start), the admin account and
  overrideHouseIds (as contestants or buyers), launchContestExcludeEmails/Ids. launchContestMinSales 2.
  Ties: sales, dollars, who got there first. Prizes launchContestPrizesPol '10,6,4'.
- Payout only by Admin > Launch week > Pay launch contest: the ranking is frozen on the first press, the
  admin's confirmed list must match it, balance + gas checked first, each place claimed once (marks.claim)
  and written as sending before award(memberId) from the Level 4 override payer wallet
  (override.payerHandle). Records tx hashes; resolve paid-with-tx or retry for blocked/failed/review.
  The prize email + feed line say "Launch week contest prize".
- /leaderboard panel from the launch moment until the prizes are paid; /launch copy states both rules.
- chatbot: CANNED founder-badge + launch-contest, FACTS lines (no amounts quoted before launch).
- qa/launchweek.test.cjs (16 checks: Central window bounds, exclusions, minimum, two-copy payout once,
  frozen result, Founder criterion + grant, touchSeen backfill); run.sh launchweek and in all.
- Versions: my.js?v=20261105fd, team.js?v=20261105fd, wall-founder.js?v=20261105fd,
  admin-launchweek.js?v=20261105lw (wall.js unchanged: the shared policy test pins it).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 08:14:28 -06:00
martbost 4b8b31abe7 Payouts switch on by themselves (Marty 2026-11-05): the chatbot's activation answer still described the old manual step (buy, or the free activation, one transaction); the code has activated members the moment a wallet is linked since 2026-10-17 (accounts.onWalletLinked -> carry.ensureOnChain, engine pays gas, sponsors first; holding-tank members wait for a match, a purchase is never held). Chatbot answer + KNOWLEDGE_DATE 2026-11-05, /launch DM swipe and the checklist item ('Payouts switched on'), common.js?v=20261105po on every page
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 07:54:33 -06:00
martbost b84eed3be5 Theme switch: auto | light | dark, stored in localStorage ls.theme and on the account, applied before first paint on every page
themehead.js is the one source of the tiny inline head script (and of AUTO_DEFAULT, the one constant Marty decides later: 0 = nothing stored keeps the page's current look, light for Control Room and public pages, dark for the sapphire pages; 1 = follow the device). The script sets data-theme on <html> from ls.theme (auto follows prefers-color-scheme and tracks changes live) and exposes window.LSTheme. tools/stamp-theme-head.cjs writes it into every static page before the first stylesheet with data-theme-base on <html>; blog, leaderboard, what's-new, the badge page, the unsubscribe page and the wall 404 read the module directly. The site CSP allows inline scripts by hash only, so themehead.CSP_HASH joins script-src (the script was silently blocked until then).

Account side: accounts.theme (JSON store and MySQL, alterSafe column), in the public account JSON and /api/me; POST /api/my/profile {theme} rides the existing profile save path and never touches the username. cr-shell.js renders a Light / Dark / Auto segmented control in the topbar of every Control Room screen and paints every .theme-seg on the page (the Profile pane gains an Appearance card with the same control); a click applies at once, saves locally and to the account when signed in; at sign-in the account value wins over the local one, and a local choice is pushed up when the account has none yet. view.html stops reading an undefined --bg so its light variant has a light stage. ?v= tags bumped on every changed stylesheet and script (20261101t / ls20261101t).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-01 10:44:40 -06:00
martbost bdf1aab06c Link-farm hardening (2026-10-30 incident: 106 free accounts synced from InstantAdPay carried casino bios and website links; Google indexed the text through /wall pages)
Public walls: profile fields (bio, avatar, socials, intro video) render only for a paying member (memberId > 0 or a registered position), on /api/wall and in the OG image; a free account's wall shows the name, the line's ads and the join call. The meta/og description is a fixed site sentence with the handle, never the bio. Outbound profile links are rel="sponsored ugc noopener" target="_blank". A deleted or unknown name is a real 404 with X-Robots-Tag noindex (was a bare "Banner wall" page at 200, a soft 404 that stayed indexed).

Policy (prohibited.js, byte-for-byte copy of InstantAdPay's): bios may not carry a URL or a domain token ("Links go in the social fields, not the bio"); gambling, adult, pharma, weapons and link-selling terms (Unicode aware) are refused in bios, social URLs, line banner targets, wall offers and every campaign field, with the refusal logged. The registry ingest from InstantAdPay drops a bio with a link or a prohibited term instead of storing it; iapsync applies the same on the way out.

Quarantine rule: a brand-new free account (no wallet, no sponsor, under 24 h) whose first profile save plants a link is saved with profileQuarantined (JSON + MySQL column), never rendered publicly, and told "Your profile links will appear after your first ad package"; the admin member card shows the flag.

Daily link-farm scan (spamscan.js, same copy as InstantAdPay): in-app job at 06:30 Central, claimOnce per day, lists memberId-0 walletless accounts with a link plus a farm signal (prohibited term, sign-in over within 15 min, no sponsor), skips the spamScanAllow setting (seeded), writes DATA_DIR/wall-spam-scan.json and sends one "LinkSpin link-farm scan" Telegram to the private admin chat only when there are candidates. Admin > Members > Link-farm list: rows with "also on InstantAdPay" (local registry mirror), Delete selected (existing DELETE /api/admin/member, on-chain refused, no cascade) and Allow.

Terms section 9 "Prohibited content", bio hint in the profile editor, chatbot canned answer + kb-seed entry "What content is not allowed?", KNOWLEDGE_DATE 2026-10-30. Test: qa/profile-policy.test.cjs (unit + local copy, hash check against the InstantAdPay copies; runs in qa/run.sh member and policy).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-30 07:32:07 -05:00
martbost 9ebbef2d21 Network rate 4:1 (Marty approved 2026-10-27, same as InstantAdPay): views off LinkSpin cost 1/synRateDivisor of the on-site rate, going forward
rates.synRateDivisor (default 4, Admin > Rates; 1 = the old rule). Network Ad Space impressions charge 1 credit per
impressionsPerCredit x N views; member campaigns shown in other members' zones on their own sites (zones.js serve,
offsite) are counted in the new synImps (not Views here) and charged one batch per N x the on-site batch (2 credits
per 40 banner views at N=4) through the same spend path, so burns follow what was charged. Fractions are exact (the
cumulative served count / the syn_batch counter carry the remainder). The budget is the limit: bookings, resume,
top-up and daily allowances are sized at the network rate, and a live ad booked at the old rate is topped up once.
Nothing already charged changes; zone owners keep earning as before. Ads screen + classic Campaigns show network and
partner-zone views marked at 1/4; chatbot canned answer + live AI fact; cache tags bumped.
QA: qa/run.sh nas (stop 9, ratio 10), loginqueue 13, refill 12, run.sh member passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 08:10:02 -05:00
martbost 2d0413037d Holding tank on LinkSpin (ported from InstantAdPay 4645d56, Marty 2026-10-27): network sponsor ALIGNMENT first, the free activation held (never a purchase), 24-hour rotation, payouts switched on the moment someone is assigned
- Align first, every path (/api/me, /api/sponsor all intents incl. buy, carry.ensureOnChain via tank.gate, 15-min readyTick): a tank member (no sponsorRef, no member number, no resolvable cookie) whose email has a sponsor in the InstantAdPay registry rows, else a signed sponsor-facts call (3 s timeout, 10 min cache, one batch per tick), else the same wallet, is placed under that sponsor through accounts.setSponsorRef when the sponsor has a LinkSpin account; never a sponsor they were adopted/released/rescued away from, never a loop. Recorded in tank-ready.json, listed in Admin tank
- Hold ONLY the plain Switch on payouts (Marty: "I would never want to hold up a purchase ... they'll just pay number one"): the engine's wallet-link activation and seeding wait, /api/sponsor?intent=activate answers sponsorBlocked tankHold; intent=buy and /api/me never block (buys go ahead under #1 as before). A sponsor activated because someone below is buying is never held. Activate buttons now call intent=activate
- Ready badge + hours left (My line tank, Admin tank, Overview count); one shared-payments-topic line per newly ready member (digest when more than 3)
- 24-hour rotation through adopt(): own $25+ buy, fewer than 2 open, seen within 7 days, not company/#1, not a no-payout chain, not own downline; least recently auto-assigned first. Nobody eligible: keep holding, one admin alert. Never #1
- Payouts on at assignment (Marty approved 2026-10-27): adopted, auto-assigned or aligned member with a wallet is activated right away by carry.activateAssigned (strict: sponsor must be on the contract and not on a no-payout chain, never the fallback; retried every tick for 7 days); the auto-assign chat/email say "Your payouts are now on under @sponsor" with the Polygonscan link, a manual adoption gets a follow-up chat + email
- Deploy overlap: marks.js claims for the activation (per member per 10 min), the auto-assign, the ready post and the admin alert
- Cross-site: someone waiting in InstantAdPay's own tank (claimed account there, no sponsor, not a member there, wallet linked) is auto-assigned by InstantAdPay only (live sponsor-facts, registry fallback); LinkSpin defers and does not post them
- Chatbot: tank-hold canned answer, holding-tank answer + facts, KNOWLEDGE_DATE 2026-10-27; cache tags my.js / credits-screen.js / admin.js 20261027th
- QA: qa/tank-hold.test.mjs (unit with mocked clock + fake engine, then a local copy with a mock InstantAdPay and a browser check of Credits), qa/carry-activate.test.cjs (regression for the 10-22 scoping bug), run.sh tankhold + sponsorfollow; run.sh borrows InstantAdPay's node_modules when this checkout has none

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 07:26:51 -05:00
martbost 4749d711f4 Refuel Kit on LinkSpin (Fuel Your Offers stage 3, Marty approved 2026-10-24): kit.js (same file as InstantAdPay) with LinkSpin's own art, entitlement from InstantAdPay's streak record through refuel.status (view.kits: month -> streak month at unlock). Ads screen Refuel Kit panel (fuel.js?v=20261024kit): Make mine, Download, Copy image link, animated at a 3-month streak, and "Load into my Banner Spin" (kitspin.js): each Banner Spin size in the kit goes into one of the member's Banner Spins of that size with room, or a new one while the tier allows (the reason is shown when it does not); the personalized file is copied into uploads like a normal Banner Spin upload, labelled "Refuel Kit <month>", target = the member's own link; loading twice adds nothing twice; files over 150 KB are refused plainly. /kitimg/<hmac> public serving, admin Settings > Refuel Kit (upload, placeholder art, preview, release), raster copies of the LinkSpin placeholder banners (public/banners/linkspin-<size>.png, from the existing SVGs) for the placeholder kit. Behind the refuelStreak switch. Chatbot CANNED + FACTS mention the kit. qa/refuel-kit.test.cjs 5 checks against the real bannerspin.js. Note: qa kb retrieval has 2 pre-existing misses (spin links vs Banner Spin, PropellerAds postback), same before this change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:44:40 -05:00
martbost ab4f1693df Refill notices on LinkSpin (Fuel Your Offers stage 1, Marty approved 2026-10-24): refill.js copied from InstantAdPay. Low (80% of budget delivered, refillLowPct), out, and idle (7 days after an unanswered out notice, 100+ credits free, nothing running): one email + one on-site notice per owner per pass, naming each ad and what it delivered, then the relaunch line (100+ credits free) or the /credits link, then the packages from the chain catalog and a streak-line hook for stage 2. Email skips drip unsubscribes and carries the unsubscribe link; the notice (kind notice) always goes. Every send is watched 45 days for purchase / relaunch / resumed / topup. marks.js: one-time claims shared by both app copies during a deploy (event_marks with a DB, exclusive file create on the shared volume without one); every send is claimed first. Settings refillNotices '1' (default on) + refillLowPct 80; admin GET /api/admin/refill, POST /run and /reset, an Overview card (admin-refill.js). qa/refill.test.cjs (12 checks incl. two app copies on one volume) + run.sh fuel mode.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 05:11:12 -05:00
martbost 010c3afdd9 Level 4 override for LinkSpin: weekly dry-run report + the payer, shipped OFF (Marty approved 2026-10-23)
override.js is the InstantAdPay module (same code, same tests) with LinkSpin defaults: qualification is the
LinkSpin contract's own buyerCount >= 5 (referred first buys of $20+, which on the $10/$25/... ladder means
$25+, the level-3 bar), house id #1, hunt up to 25 hops, one recipient per purchase, purchases from
overrideGoLive on, weekly Mon-Sun Central, settled Monday after 9 AM CT.

- Default overrideMode 'dryrun': Monday who-would-be-paid summary to the admin Telegram chat
  (telegramAdminChatId; email to ADMIN_EMAIL if the bot is not set). No money moves.
- Payer pays only with overrideMode 'live' + overrideGoLive + OVERRIDE_PAYER_KEY. LinkSpin has no MySQL,
  so every once-only step is an exclusive file create on the shared volume (fails closed); plan frozen
  per week, 'sending' persisted before the tx, lost answers -> review (never re-sent), dust carried,
  weekly cap held whole, balance + gas checked first.
- Members: AwardPaid from the payer emails + on-site notice "Your Level 4 override is paid"; Wallet
  screen and feeds label it "Level 4 override". /api/my/activity now reads the whole history (was the
  last 600 events, the IAP bug of 2026-09-16; LinkSpin is at 525).
- Admin: /api/admin/override (+ status, payer), POST /pay (live only), POST /resolve; P&L card.
- Contract page: Level 4 override panel hidden until overrideMode is live (contract.js reveals it).
- qa/override.test.cjs (bash qa/run.sh override): 30 checks, fake chain/signer, throwaway data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:20:02 -05:00
martbost 1c2ef3780c Prepaid login-ad slot queue (Marty, 2026-10-23: "they need to pay for the slot now to get a place in line")
When all member login slots are taken the Ads screen offers "Reserve the next slot" instead of a dead button.
Same price and checks as a slot (purchased credits only), paid at reserve time; the campaign is 'queued' with
queuedAt, never serves and has no 30-day clock. First paid, first served: the member sees their place and an
estimated start (Central time, labelled an estimate) built from the live slots' end dates and the line ahead.
A freed slot (ended, paused, or found by the new 1-minute tick) goes to the oldest reservation: starts now,
expires now + 30 days, never more than loginSlotsMax live. Idempotent across the deploy overlap: JSON mode takes
a lock file and records every promotion/cancel in DATA_DIR/login-queue.json, re-read before any change; MySQL
mode uses guarded UPDATEs (status + live count in one statement). Owner gets an on-site notice and an email
(unsubscribes respected). A paused slot resumes only when live + queued < max. Cancel before start = full
refund (credited back as purchased credits; any unburned accrual released). Edits while queued are free and keep
the free correction. Admin: Login-ad queue card with cancel + refund, plus the Member content action.
New credit activity log (credit-log.json / credit_log table): reserved (queue #N), bought, started, refunds,
shown on the Ads screen. Audit skips queued/cancelled login rows. Chatbot CANNED + FACTS updated (6 slots, paid
queue, full refund before start). Tags bumped: ads-screen.js, admin.js, my.js 20261023q.
Tests: qa/loginqueue.test.cjs (two app copies promoting at once) + qa/loginqueue.e2e.mjs; bash qa/run.sh loginqueue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 07:11:37 -05:00
martbost a5c2c38106 Sponsor follow + one network holding tank + Sponsor check (Marty, 2026-10-22, approved 1-3)
Same design as InstantAdPay (shared sponsorfollow.js). Deliberate sponsor changes (tank adoption, rescue, release,
adoption window ending, admin edit) are recorded and travel on the iapsync rows; InstantAdPay's deliberate changes are
applied here only when the member is not bound or binding on the LinkSpin contract (memberId, wallet on chain, or an
engine activation in flight), newer than our own, and both sides agreed before (or no sponsor here). Bound / diverged /
race cases change nothing and are logged. Ordinary rows keep the fill-empty rule, except a sponsor emptied on purpose
here is not refilled by an ordinary row.

Carry: an InstantAdPay batch holds its members (carry.hold) so no auto-activation starts mid-batch; ensureOnChain waits,
then re-reads the account so the contract binds the settled sponsor; wallets from a batch are linked after every sponsor
decision; the wallet hook skips activation while a follow is pending and activates once it is settled.
Registry keeps the follow record (loop guard) and a deliberate clear. Network tank, Admin > Members > Sponsor check and
the partner endpoints as on InstantAdPay. Rows without the new facts hash as before (no resend on deploy).

Tests: qa/sponsorfollow.test.cjs 27/27, qa/carry-hold.test.cjs ok, two-server e2e (in the InstantAdPay repo) 20/20,
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:20 -05:00
martbost 08bfa2afd7 Team + Ads colour (Orlando's ask): Team rows carry the Pipeline stage colours (stripe + stage pill), amber quiet-3+-days flag and filter chip; ad status traffic light (live, running low at 80% spent, out, paused) on the pill, row stripe and budget bar; QA walk rebuilt for the Control Room sign-in and rail screens; cache tags bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 07:22:44 -05:00
martbost a736d68c30 Merge LinkSpin knowledge-base chatbot (Banner Spin answer moved into a KB entry)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:52:02 -05:00
martbost f93bca81a7 Banner Spin phase 3: reports, health checks, postbacks verified, admin switch button
- bannerspin.js: every image load also counted raw per placement (bots/prefetch and servers/mail image proxies kept apart from views); one aggregation for the Stats tab and a new summary() for Reports: per banner (views, uniques, clicks, CTR, match rate, conversions), per placement with a "caches banners" flag, by Central day, country and device, bots shown separately; WINNER badge once two live banners have 1,000 views each and one leads on CTR. Click params now keep the banner macro (same list as spin links). Owner pause/resume clears an auto-pause; a new image or target resets health.
- health.js: the 30-minute pass also checks each live banner: image must load as an image (magic bytes) at the Banner Spin size, target must pass the spin-link checks (a spin-link target only has to exist). 3 failures pause, 2 clean passes resume, the last live banner is never auto-paused; owner gets an inbox notice. checkBannerSpins() for admin.
- server.js (own blocks): health.init gets bannerspin; /api/my/reports adds bannerSpins; POST /api/admin/bannerspins/health runs the checks now.
- Builder: health line + AUTO-PAUSED tag on every banner row; Stats tab adds uniques, WINNER, CACHED placements, loads, country/device, bots line.
- Reports screen: Banner Spin section + Banner views/clicks tiles beside spin links.
- Admin > Member content: real Banner Spin on/off button (with confirm) and "Run banner checks".
- Traffic-source postbacks on Banner Spin clicks verified end to end (network click id, event, payout, lsid reach the source postback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:39:50 -05:00
martbost 541457bc24 Chat knowledge base: the assistant answers from maintained entries (port of InstantAdPay's kb.js)
- kb.js: entries { id, title, questions, answer, tags, pattern, handoff, order, source, updated } in DATA_DIR/kb.json (temp file + rename). BM25 over title, question variants and tags (answer at a low weight) with word bigrams; the top hits go into the system prompt as KNOWLEDGE BASE, and when nothing fits the prompt says to answer "I'm not sure, ask support" (Help at SITE_URL/help).
- One source: chatbot.js CANNED seeds the KB (ids c-*, regex = instant-answer pattern, same first-match order); kb-seed.js seeds the network notes from the home page, the wallets guide FAQ, the earning guide and the Coinbase support reply in LinkSpin wording (f-*). The fast path serves the KB entry; 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, Try a question. Em dashes in admin input become commas.
- chatbot.js: reasoning off for deepseek (as on IAP), keepalive-padded OpenRouter replies parsed, OPENROUTER_URL override for tests, KNOWLEDGE_DATE 2026-10-20. New public GET /api/chat/kb-stamp.
- QA: qa/kb-retrieval.cjs (12 sample questions rank the right entry first), qa/kb-chat.mjs (local copy + mock OpenRouter), bash qa/run.sh kb; walk lists admin#kb.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:38:46 -05:00
martbost 7be213311f Ad editing: fix the link, image, text or name of a running ad; first edit free, then campaignEditFee credits
Orlando (#30) could only pause, resume or top up a banner or login ad with a wrong link.
- POST /api/my/campaigns/<id>/edit (owner) and /api/admin/campaigns/<id>/edit (any ad, free,
  never uses the member's free edit). Banner: link, image, name. Text: link, headline, line, name.
  Login and the rest: link, name. Type, size, budget, geo, schedule, audience are refused.
- Create and edit share one path: checkName/checkTarget/checkBannerImage/checkTextCopy in ads.js
  (validate() now calls them) and adChecks() in server.js (frame check + a new banner image check:
  loads, is a real PNG/JPG/GIF/WebP, up to 3 MB; own uploads read off the volume).
- Fee: campaigns.edits counts member edits; the first is free, each later one costs the site
  setting campaignEditFee (default 100, admin Settings). Charged from the engine pool via
  spendEarned (earned first, then credited purchased); with neither, a burn row on the
  best-funded position (the normal burn queue). Guarded claim so two saves cannot both be free;
  a failed save refunds exactly what was taken.
- History: campaigns.edit_log (ts, by, fields, old/new values, fee), last 50.
- NAS: clicks already route through /api/ads/click/<id>, so a new link needs no write; a new
  image or text goes to the NAS row via nas.updateCreative. Failures never block the edit and
  retry on the next reconcile pass. Open ad-viewer tokens get the new link.
- UI: Edit button on the Ads screen (CR.dialog editor, real-size preview, upload, free/fee note
  and confirm), /ads#edit=<id> deep link from the /tools list, admin Member content shows edit
  count + history with an Edit action. Chatbot canned answer + FACTS.
- qa/adedit.mjs: 51 checks against a throwaway DATA_DIR, Playwright screenshots in D:/tmp/ad-edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:24:05 -05:00
martbost c4d6cdfb3d Pipeline colours: stage rules now outrank the grey default
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:44:03 -05:00
martbost 4dae478902 Pipeline board colour: one colour per stage (tinted column, top bar, coloured title, count pill, card stripe), white cards with dark names, amber stalled cards and chips; cache tags bumped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:42:19 -05:00
martbost c963226703 LinkSpin copy: every $20 qualifying-package reference is now $25 (LinkSpin sells $10, $25, $50, $100, $250, $500; there is no $20 package), first package From $10, the $10 test, partner kit split on a $25 package, team-building math; POL suggestion looks up the $25 product (the $20 lookup never matched); cache tags bumped. The $100 split examples ($20 level 2 / platform) are unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:23:03 -05:00
martbost 406113bc03 Banner Spin engine (phase 1): /i/ image with no-store + fresh ETag, /c/ click matching (visitor key + placement host note, 15 min) with fallback, /s/ exact-match script embed, impression counters flushed every 5 s (read-add-write), banner clicks with lsid conversions + source postbacks, tiers ($25 own package; Starter 2x5, Builder 5x15, Leader 10x25), member + admin API, admin kill switch per Banner Spin / per banner / global, Banner Spins in admin Member content
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:58:44 -05:00
martbost afede88c4a Admin Member content pane: every page, link, source, zone, ad, postback, upload, profile, broadcast, audience and video members made, in one list
- GET /api/admin/content?type=&q=&from=&to=&flagged=1&page=&per=&fresh=1 (admin only, read-only): content.js normalizes
  rows from each module's own adminAll() (new one-pass accessors in pages, rotator, sources, zones, postbacks,
  audiences, messages.adminBroadcasts, videomaker.adminJobs) plus ads.adminList and accounts.listAll; owner shown as
  @username, email and member #; created in Central time; totals per type; busiest hosts in the current view
- Flags: open member reports on an ad, dead or parked destinations, burned link domains, failing postbacks,
  admin-paused zones, home-page demo links. No deny list exists yet
- Row actions only reuse existing moderation routes (campaign pause/resume, zone pause/resume); "Open member" jumps
  to the member card; page Preview works for drafts and is never counted (admin allowed on ?preview=1)
- Uploads: /uploads files now recorded with their uploader in uploads-index.json; older files get the owner from
  whatever uses them (campaign creative, profile, wall offer)
- Credits > Your purchases: buys made from linked positions are included, labelled "Position N"
- Cache tags: admin.css 20261018a, admin.js 20261018b, credits-screen.js 20261018b

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 07:01:58 -05:00
martbost 8a1a6b1f6d Chat bubble back on every Control Room screen: the shell loads chat.js once per page (it only lived on the retired /my dashboard); Control Room styles for the widget
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 06:35:55 -05:00
martbost 57b8eb4208 Login ads: flat 30-day slot, same as InstantAdPay
- Engine (JSON + MySQL twin): login ads are a slot buy (loginSlotCredits 1000,
  loginSlotDays 30, loginSlotsMax 3, dwell 10 s). createCampaign pins the budget
  to the slot price, sets the 30-day expiry and charges it once, purchased credits
  only (credited purchased grade first, the rest burns on-chain; viewing credits
  never pay). countLoginSlots counts live member slots (house never counts); a 4th
  is refused while 3 are live. Sign-in pick prefers member slots over the house.
  The per-day charge loop only runs for legacy login ads with no expiry.
- Day keys on Central time (ctDay / dayKeyNow / today) instead of UTC toISOString,
  incl. login lastShownDay, the daily sweep, claim streak and sign-in bonus.
- Beyond IAP: resuming a paused slot obeys the same cap, top-up is refused on a
  slot, the audit's days-charged check skips slots, JSON grantWelcome keeps the
  purchased grade.
- Ads screen: slot wording, loginSlots { max, used, free } from the API, chip and
  cost line show open slots, Launch disabled with an explanation when full; no Top
  up on slots; classic dashboard, earning page, admin rate labels and chatbot
  (canned answer + FACTS, KNOWLEDGE_DATE 2026-10-18) updated. Cache tags bumped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 05:45:30 -05:00
martbost 44d40863db Ads screen layout by real width + Qualified Start positions on Credits (wallet switch fix)
Ads: the campaign table squeezed its empty-state note (and the first column) to a
word or a letter per line beside the side cards. Container queries now stack the
side cards under the table and turn rows into cards when the table cannot hold
seven columns, whatever the rail state. cr.css: an empty-state row (one muted
note) spans every column on every Control Room table.

Wallet: Disconnect really lets go (keeps wagmi's disconnected marker, revokes the
injected permission, next connect opens the account picker), so MetaMask no longer
snaps back to the first account. Credits gains Switch account, Disconnect, Add a
position wallet and a Buy from picker (ported from the classic Buy pane), so a
member can add wallets #2..#5 and buy from each while staying signed in as
themselves. Classic dashboard and Wallet screen copy point to it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 05:15:15 -05:00
martbost df1b900f45 Support: Help screen, public /support page, ticket link and chat hand-off on InstantAdPay's shared desk
helpdesk.js proxies to InstantAdPay's partner API (/api/partner/support/*), signed with the
same LS_SYNC_SECRET + X-LS-Ts/X-LS-Sig as iapsync.js, IAP_URL as the base. No tickets are
stored here.

- /help: Control Room screen (list, new ticket with the desk's categories, thread, reply);
  Help on the rail with an unread badge when Marty has replied (/api/my/support/unread, 60 s cache)
- /support and /support/t/<token>: public form + private ticket link, behind the sign-up
  guard's walls (honeypot, form age, IP/email limits, icon check) on their own counters;
  these pages, their API and their files pass the curtain for anonymous visitors
- chat bubble: "Send this to support" hand-off, greeting points to Help and /support;
  chatbot flags hand-off on support questions and unsure answers; CANNED + FACTS updated,
  KNOWLEDGE_DATE 2026-10-16
- Support in the home nav, common.js nav/footer and every public footer; copy that said
  "message support" now points at Help
- cache tags bumped (common.js, cr-shell.js, chat.js, my.js, credits-screen.js)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 18:05:02 -05:00
martbost d1a25e72f2 Admin wears the Control Room: light workspace, dark rail and topbar, Instrument scheme
The /admin console now looks like the member screens instead of the dark-navy
site.css back office (Marty: "the admin should be the same color as the site").
Same recipe as /tools (2026-10-08): cr.css is the design system, site.css loads
inside @layer legacy so the cr tokens win, tools.css restyles the shared legacy
panes, and the new admin.css does the admin-only parts.

- admin.html: page wrapped in #page; the pane menu (nav.bo-menu, same
  data-pane buttons and ids) is a dark rail with the Collapse toggle and Site
  links; topbar carries the crumb, #boTitle, #chainLine readout, admin who
  pill and Log out; a status strip with the chain and a Central clock; the
  sign-in card centred on the light workspace. Inline <style> moved to
  admin.css; the two dark-only inline backgrounds switched to panel tokens.
  Cache tags: admin.css/admin.js ?v=20261012a.
- admin.css: rail buttons mirror cr .rail a (wide and icon-only, phone bottom
  bar scrolls with icon + label), tables with mono headers and hover rows,
  status pills and the house tag in the light scheme, drip steps, rates and
  kv forms, label-wrapped inputs, blue action buttons, phone grids.
- admin.js: rail collapse remembers cr.rail like the member shell, strip
  clock, strip chain line, error text uses var(--bad) instead of #ff8a8a.

Member rail and cr-shell.js are untouched; the admin sign-in flow is the
same /api/admin/auth endpoints as before. Verified locally with Playwright
at 1366x900 and 390x844 on every pane plus /links as a member.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 10:55:10 -05:00
martbost 0a30b1da60 Link-domain pool by channel + safety checks, hosted page images + provider allowlist, Reports pages and zones sections
Item 1 (domains.js): every short link domain in linkDomains gets a channel (email / messaging / social / reserve)
via the new linkDomainChannels site setting ("host:channel,..."; default order email, messaging, social, email,
reserve). Checks every 6 h + Admin > Link domains "Check now": Google Safe Browsing v4 when GSB_API_KEY is set
(unknown otherwise), URIBL + SURBL DNS lists (answer = listed, NXDOMAIN = clean, 127.0.0.1 or errors = unknown),
and a TelegramBot-UA reachability probe. Flagged or listed = BURNED: out of domains.live() (no new links or
pages on it, existing /r/ codes still resolve), admin told once via telegramAdminChatId or ADMIN_EMAIL.
State in DATA_DIR/domains.json. New: GET /api/my/link-hosts, GET+POST /api/admin/domains, admin pane.
/api/my/pages now hands out hosts from domains.live().

Item 2 (pages.js, formrestyle.js): POST /api/my/pages/upload (raw image body, multipart, or JSON base64) for
png/jpg/webp up to 2 MB, 50 per member, magic bytes checked, sharp re-encode when installed, stored under
DATA_DIR/uploads/pages/<owner-hash>/<id>.<ext>, served at /u/pages/... immutable for a year; delete via
POST /api/my/pages/images/<id> {remove}. Pages editor: Upload image button beside the image field + a strip of
the member's images. Provider allowlist (17 autoresponders, Sendy by /subscribe path) exposed as `providers`;
the editor says "Recognised: AWeber" or "Unknown provider: plain post to <host>" at paste time; pub() carries
formProvider. Unknown hosts still allowed when parse-or-refuse passes.

Item 3 (zonereport.js, pages.summary): /api/my/reports returns {spins, pages, zones} (spins still spread at the
top level) for the chosen days; Pages and Zones sections on /reports with 30-day bars, totals, per-item tables,
phone width checked. Zone numbers are a read-only view over zones.json (zones.js untouched).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 11:28:47 -05:00
martbost 3eda2fe0cc Blog surfaced (header nav, home strip, footer) + five seed articles with kit-derived covers and the seed/publish tooling; zones: network tier default OFF until NAS is switched on at the end of testing
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-09 06:24:55 -05:00
martbost 8ec82bd282 Retire the classic /my dashboard: control-room screens take over (links/ads/credits/wallet/team), leftover panes (welcome tour, line broadcast, pipeline, promo tools, training, profile) live at /tools as 'More' in the rail; /my redirects by #pane; every link and email retargeted
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 15:37:00 -05:00
martbost ad744d8c0f Site host from one module: host.js exports SITE_HOST/SITE_URL and every module, email, Telegram post, QR, ad click URL and OG tag reads it (no more hard-coded test hostname); public pages carry {{SITE_URL}} filled at serve time; frame check carries the curtain pass for our own hosts so a test ad can point at a spin link; stale IAP sitemap removed
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 08:52:04 -05:00
martbost cfb9ed13d0 Zones guardrails: origin lock to the declared site, warm-up then earning, hold under 40% viewable, admin Zones pane with pause
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 17:38:08 -05:00
martbost 00ab223ce6 LinkSpin marks: wordmark in every header, LinkSpin logo and icon files, split brand strings replaced 2026-09-16 04:41:16 -05:00
martbost c5ffe1570e LinkSpin identity: sapphire and chrome after the Nexus badge, Rajdhani display type, circuit texture, wordmark logo 2026-09-16 04:37:18 -05:00
martbost 010e8d7ffc LinkSpin test area: InstantAdPay engine fork rebranded, network registry, sponsor carry-over with engine activation and claim window, rotator with /r/ redirects, link-domain mini-sites
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-15 16:16:52 -05:00