Commit Graph

20 Commits

Author SHA1 Message Date
martbost bd5ed4e370 Owner account (ADMIN_EMAIL) has no link or source cap (Marty 2026-11-17: 'since I am the owner, I don't want a limit on my account'); members keep 100 links / 30 sources
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 09:17:52 -06:00
martbost f4789156b8 Member erase (Marty 2026-11-15, ticket LS-1021): POST /api/admin/erase {email, dryRun (default true), force} + the hub's member.erased event
erase.js runs inside the app so the documents modules keep in memory and the MySQL docs rows stay consistent. Refused
unless force: a main wallet, an on-chain member number, positions, a team here, ads running or queued. Removes the
account, their spin links with every click row in rot_hits and conversions (rotator.eraseOwner, docstore.rowsWhere),
and scrubs every document that mentions them with scrub.js (same file as InstantAdPay) through the owning module's live
copy: accounts, audiences, coach, convtrack, earned (unspent credits go away), hubsync, iapsync, mail-intro, postbacks,
registry, rotator, sponsorfollow; others (updates-log, ...) through docstore. A 30-day email-hash tombstone (erase.json)
stops the InstantAdPay registry sync and hub events from bringing them back; the log keeps hashes and counts only.
hubsync handles member.erased {emailHash}. qa/erase.test.cjs 6 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 12:29:33 -06:00
martbost d6e8de3e6a Partner endpoint for DownlineHydra tracked program links (Marty 2026-11-15): POST /api/partner/dh/links, net.v1-signed with NETWORK_SSO_SECRET. op ensure makes or updates one link per program on the member's own account (by email, else network username), tagged with a new 'DownlineHydra' network source and the program id as sub-id (?s1=&placement=), clean link host from domains.hosts(); op stats answers clicks per program. rotator.ensurePartner / partnerStats; catalog template downlinehydra; NET_SRC dh. qa/partner-dhlinks.test.mjs 13/13, partner-spins 13/13, netsrc 16/16. LOCAL ONLY, not pushed or deployed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 05:26:46 -06:00
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 1554c262a6 LinkSpin data in MySQL (Marty 2026-11-13: 'everything database-driven'). docstore.js: every .json/.jsonl data document under DATA_DIR lives in MySQL table docs (DOCSTORE_URL), served to the modules through their own fs calls from an in-memory copy, written through in order; one writer at a time (docs_writer), so an older copy during a deploy can never overwrite newer data; first boot imports each file and sets it aside (.imported-<date>). Spin-link clicks are rows in rot_hits (one insert per click instead of rewriting a 20 MB document; every click kept). Kept as files on purpose: chain-index cache, uploads, geo db, kits, marks, queues. Admin sessions load after the store. Rehearsed on a copy: 52/54 documents byte-identical (rotator.json minus hits, kb.json seeds refreshed), 97,579 clicks moved, links + clicks work after restart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:25:59 -06:00
martbost d1c9d62801 Data safety (2026-11-13 incident: a deploy read a half-written rotator.json, the store fell back to empty and its next save wiped 294 spin links): safefs.js makes every .json write inside DATA_DIR atomic (temp file + rename); LinkSpin's rotator refuses to start empty when rotator.json exists but will not parse
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 09:11:27 -06:00
Marty Bostick 5d79abe318 BTC4Hits import, round 2: tank cap 10 at one time (setting tankAdoptCap) with tests; BTC4Hits origin kept on carried shells (joinedRef btc4hits) and the adoption note/email/auto-assign message say their BTC4Hits account moved here; imported spin links may carry every valid URL (admin route maxDests up to 2000, one save per batch), editor shows 50 rows of a big link with Show all, Check now runs in the background past 50, at most one pause email per link per day; chatbot knows /from/btc4hits + the cap (KNOWLEDGE_DATE 2026-11-11). qa: tank-cap 15/15, tank-hold all passed, btc4hits-bridge 21/21, sponsorfollow 30/30
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 08:08:58 -06:00
martbost eedc15bc13 Conversion linkage, LinkSpin side (Marty 2026-11-07, "Yes ship these"): InstantAdPay's sign-ups, wallet links and package purchases on a click count for the click's owner, in one Conversions list. Reporting only: no sponsor, payout, credit or chain path changes.
The landing tag (t.js) adds the kept click id to links to linkspin.app, instantadpay.com and the share domains, also inside a member's own redirect link (Orlando's buttons are go.opgnetwerk.com/go?u=<encoded join link>). Spin and Banner Spin links are left alone and only LinkSpin's own id shapes travel. A spin link or Banner Spin pointed straight at those sites carries lsclk with no goal set up.

netconv.js: new partner op 'events' on /api/partner/conv. Append-only ledger DATA_DIR/netconv.jsonl so two app copies cannot overwrite each other, marks.claim plus the ledger keys for once-only, join and wallet once per root click, every purchase by its own key, 30 days from click to event, the first account on a click owns it, the click owner's own account and own clicks kept as tests, each row keeps what the click was so later events survive the hit ageing out of the rotator. Spin events mirror into rotator.conv (replayed on a timer) so per-link counts, sources and placements see them; postbacks fire as for LinkSpin's own conversions.

Reports > Conversions lists goals, joins, wallets, purchases, leads and partner postbacks with values, each once; per-link Conv. counts include goals. /join keeps lsclk as well as lsid. Guide, /conversions, privacy and chatbot (CANNED + FACTS) updated; reports.js and join.js tags bumped.

The false Pages webhook claim is gone from chatbot.js, join.js and the home page: leads go to the member's list and CSV, or into a pasted autoresponder form.

QA: bash qa/run.sh netconv (57 checks, also runs in member).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 07:46:43 -06:00
martbost d22b8adada Daily LinkSpin snapshot card (Marty 2026-11-02): spin links served, Banner Spin views, zone views, page views and leads, then sign-ups, purchases and POL paid, posted once a day to the LinkSpin Support topic (new target 'support', settings telegramSupportChatId/TopicId); window24() helpers on rotator, bannerspin, zones and pages; POST /api/admin/snapshot/send takes {target} for a one-off
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-02 08:17:38 -06:00
martbost dd2244272b Conversion pixel engine (Marty approved 2026-10-23): goals with public pixel ids, click ids on every ad click (lsclk, 'a'+11 hex), spin links pass the ad click on, landing tag /t.js + goal pixel /cv.gif /cv.js matching url > stored > cookie > 24 h soft key, once per click, 30-day window, owner check, rate limits, goal postbacks (event 'goal'), member + signed partner APIs for InstantAdPay
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:10:46 -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 f47c4ecd54 Rotator: shared Central-day formatter in summary (toLocaleDateString with timeZone built a formatter per hit; the status strip took ~4 s)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:08:05 -05:00
martbost 1c400bd87d Rotator: reuse one Intl.DateTimeFormat per time zone in cellAt (bestHours built one per hit; a 10k-hit link's stats took ~4 s and blocked the event loop)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 17:05:53 -05:00
martbost 211eb5a0e8 Traffic sources: network macros, campaign URLs, per-source postbacks, Reports dimension
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>
2026-10-12 11:16:24 -05:00
martbost 97b206f3b5 Dayparting + automatic destination health checks for the rotator
Hours: rotation.hours / destination.hours = null (always on) or 7 strings of 24 chars '1'/'0' (index 0 = Sunday); rotation.tz = IANA zone name or 'visitor' (country -> representative zone, Central when unknown). Outside the link's hours visitors go to the fallback (hit.oh = 1 so stats show it); a destination outside its own hours is skipped by the pick. Presets always/business/evenings/weekends, server-side validation of grid and zone (Intl), "my best hours" = top quarter of weekday-hour cells by uniques over 30 days, unlocks at 200 clicks.

Health (health.js): every 30 min each active destination and the fallback is fetched (10 s timeout, 5 redirects, HEAD then GET, 4 at a time) and classed ok / slow / dead / parked, with frameBlocked noted. Three failing checks in a row pause the destination (never the last live one of a rotation without a fallback); paused ones are re-checked every 6 h and come back after two clean passes only when LinkSpin paused them. Owner gets one on-site inbox notice per pause. POST /api/my/rotations/:id/health = Check now, once a minute.

Links screen: Hours chip + inline 7x24 editor (tap, drag to paint, presets, zone picker, plain-English summary, heat tint), per-destination clock button and chip, health dot + line per row, Check now button, auto-paused note.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-10 11:21:23 -05:00
martbost 75d95d84d6 Scanner and rotator accept bare domains (scheme added for them); clearer scanner error
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 16:27:17 -05:00
martbost dfb677bb09 New public home on the Instrument scheme: working demo (paste up to three pages, get a live spin link on a link domain, email code to keep it; demo spins are per browser, five per IP per hour, expire after 24 h unless claimed at sign-in), live strip from the chain and the rotator, the three free tools, the split card, the six-package ladder read from the catalog, LinkSpin share image; pub.css for every public page
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 08:58:57 -05:00
martbost 8e1ddb892f Control Room: shared shell with in-shell sign-in, Reports, Team and Wallet screens; postback rails (click ids, macros, lsid attribution, conversions, outbound + inbound postbacks with SSRF guards)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 15:52:07 -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