networksso.js (the same file on every network site): with HUB_SSO=on /sso/start asks the network hub, /sso/in takes the hub's h1. token (this site's HUB_SECRET, iss hub, aud linkspin, 60 s, single use, state cookie) and falls back once to the pairwise InstantAdPay check when the hub has nobody. networksso.page() on every GET of the main host: a signed-in member's page load tells the hub once (nsso.hp) and pings /v1/activity once a day, only while the hub answers /health.
Sessions: SESSION_TTL_HOURS (168 = 7 days in production), renewed on use at most hourly; cookie 30 days, the server's sliding expiry decides. auth.endSessions.
Sign out everywhere: POST /api/auth/logout-everywhere; the account menu's Sign out asks "Only LinkSpin or every network site"; cr-shell.js?v=20261115hub. hubsync: member.blocked and member.signedout end every session of that member here.
Chatbot: a sign-in lasts 7 days and renews; the silent check is every 2 minutes.
Tests: qa/networksso-hub.e2e.mjs (same file as InstantAdPay, in run.sh). qa sso: ALL PASSED; qa member: ALL PASSED (known warnings).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Login ad: every Control Room page asks (cr-shell.js loginAd, the per-tab sessionStorage guard is gone); the server answers with an ad only when the member's last finished view on LinkSpin is older than loginAdEveryHours (site setting, default 3). loginadclock.js (the same file as InstantAdPay), MySQL table login_ad_views through DOCSTORE_URL. POST /api/ads/login/seen at the end of the countdown restarts the clock only if the serve was dwell-2 s earlier. Member erase forgets the row. Admin site setting label.
Signed out: /api/ads/slot?type=login draws nothing and counts no view (bots, probes, previews cannot run up an advertiser's numbers).
Hop: a member who signed in here because another network site asked ("Sign in with LinkSpin", nsso.back) goes back there after the login ad (/sso/resume), from every Control Room screen, not only the retired /my.
networksso.js: the network-wide copy (loop guard 120 s, fivex, unknown r refused); fivex added to the wallets map (FIVEX_URL, default https://5xyourteam.com).
Tests: qa/networksso-partner.e2e.mjs (same file as InstantAdPay, in run.sh): partner via LinkSpin, LinkSpin clock, signed-out slot; networksso e2e retries a keep-alive ECONNRESET. qa sso: ALL PASSED; qa member: ALL PASSED (2 known warnings; networksso e2e flaked on ECONNRESET once, passes with the retry).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1. Top-up across positions: an ad burns from ONE position, and topUpCampaign only looked at the ad's
own position (or the main one when the list row had no memberId), so credits bought on a linked
position could never top up the ad. Ported from InstantAdPay 2026-09-27 (Jim Watts): the ad's real
member id is read from the campaign row; when it cannot cover, the refusal names where the free
credits are and offers switchOptions; with the member's yes (switchTo, only a position on the
account) moveFunding settles what the ad already ran up on the OLD position, moves the ad, then
tops up. Ads screen asks in-page (own dialog) and retries. Create already had the largest-position guard.
2. Toasts: errors stay until closed (close button, role=alert), other notes 3.5 to 9 s by length.
3. Banner Spin per-banner clicks: his 3 clicks were all unmatched (no view on record for that browser),
so they landed on the fallback row and every banner said 0. Click matching now also tries the same
connection (daily-salted IP-only hash) when the browser key finds nothing (mail/exchange app view,
click opened in the phone browser), view notes last 60 min instead of 15, and the stats split
'Fallback shown' from 'Clicks not tied to a banner' so the rows add up to the total. History is not
backfilled: views were never stored per visitor, so old clicks cannot be tied reliably.
4. Holding tank: hub-made waiting accounts with no sponsor are in the tank (waiting, rescue, readyTick
read listAll with { shells: true }; 'hub-shell' no longer holds anyone back). Locked / sponsored /
unknown, grace, 2-adoption cap unchanged; readyTick still never switches a shell on;
accounts.listAll default unchanged (mailings skip shells).
Assets: cr.css, cr-shell.js, ads-screen.js ?v=20261114tu, banner-spin.js ?v=20261114bc.
QA: walk member 0 bugs (36 ok), netconv 57/57, networksso ALL PASSED, tank-hold all passed (new hub
shell part), profile policy 16/16, new topup-positions 8/8, new bannerspin-attrib 7/7, bannerspin e2e
75/75, hubsync 15 checks, tank-cap 15/15, sponsorfollow 30/30.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
networksso.js (same file in both repos): /go/iap hop for signed-in members' cross-site links; /sso/start (state cookie +
30-minute loop guard) -> InstantAdPay /sso/check -> /sso/in?t=<v1 HMAC-SHA256 token, NETWORK_SSO_SECRET, 60 s, single-use nonce,
bound to the browser's state cookie, email, audience and a same-site relative path>. App host only (not link/pages hosts).
Member sessions only (admin portal never shared), ordinary 4-hour session. An email not here yet (sync not run) or not on
LS_TESTERS gets the normal email-code sign-in, email prefilled; nothing is created. Silent check on every Control Room screen
(cr-shell.js loads public/assets/netsso.js); never for bots/fetches; sign-out pauses it 12 hours. Engine Room, Fuel and the
arrival strip's Back to InstantAdPay go through /go/iap. Chatbot knows it (KNOWLEDGE_DATE 2026-11-12). Off until
NETWORK_SSO_SECRET (32+ chars) is set. ?v= bumped (cr-shell, fuel, engine-room: 20261112sso).
qa: networksso.test.cjs all passed, networksso.e2e.mjs (both servers, real browser) 31/31, run.sh member green (0 bugs)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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>
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>
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>
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>
A Source is a first-class record of a network a member buys traffic on (PropellerAds,
Zeropark, Adsterra, ExoClick and 25 more from the shipped catalog, or defined by hand).
It remembers the network's macro tokens and conversion postback, attaches to spin links,
builds the exact campaign URL to paste into the network, fires that network's own
postback only for clicks that came through it, and shows up in Reports by source and
by the zone / placement / site the macro carried.
- data/traffic-sources.json: catalog of 29 networks (BeMob template harvest), un-ignored
via data/* + !data/traffic-sources.json; loader tolerates missing fields, null costModel,
{{slot}} labels with spaces and parentheses, optional slots, unknown single-brace macros
- sources.js: DATA_DIR/sources.json model, 30 per account, 20 params, key allow-list,
postbacks.validateUrl on the filled postback; list/create/update/get/urlFor/test
- rotator.js: update() takes sourceId (owner-checked), pub() exposes it, hits and conversions
are stamped with the source at click time (sr), wider query allow-list (cost, creative,
site, banner, keyword, geo, os, browser, device, carrier, format, external_id, visitor_id),
summary() adds sources[] and placements[], sourceCounts(), detachSource()
- postbacks.js: fire() delivers the matching source's postback after the manual ones through
the same deliver() (guards, retry, rate cap, auto-disable); log rows carry source; convertFor,
inbound and the page lead path pass sourceId; fill/deliver/logForSource exported
- routes (GET and POST): /api/sources/catalog, /api/my/sources, /api/my/sources/<id>,
/api/my/sources/<id>/url; /sources screen
- /sources Control Room screen (list + Campaign URL / Postback / Settings tabs, two-step
New source dialog); Links share kit gets a source select and a "Campaign URL for <network>"
first row; Reports gets Traffic sources and Placements; rail entry; chatbot canned answer,
FACTS line and KNOWLEDGE_DATE 2026-10-12
- cr.css: phone rail icons only at 34px so ten entries fit; cache tags bumped to 20261012a
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>