Commit Graph

13 Commits

Author SHA1 Message Date
martbost e545343fe0 Michael Camire fixes + hub shells in the tank (Marty 2026-11-14, LinkSpin Support)
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>
2026-11-14 11:59:38 -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 cc7c1d36af Login slots spell out the one-position rule (Michael Camire 2026-11-03: a reservation with 1,000 credits split 618 + 382 failed in a 2-second toast he never saw): GET /api/my/campaigns carries loginFunds (each position's free purchased credits); the composer shows "Paid from one position" with the per-position numbers and disables Launch/Reserve when no single position covers the slot; a login-specific 400 says nothing was charged and what to do; login failures open a dialog instead of a toast; chatbot fact; ads-screen.js?v=20261104lf, KNOWLEDGE_DATE 2026-11-04. loginqueue unit 13/13, e2e 36/36
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 07:23:46 -06: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 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 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 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 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 92c5b777da First-party retargeting: audiences (automatic 'My visitors' fed by pages + zones, custom pixel audiences via /p.js + /p.gif, ls.vid cookie + 24 h soft key), include/exclude audience targeting on banner/text/login campaigns, zone tag sends credentials with CORS echo, audience-targeted campaigns never syndicate, Audiences panel on Zones and selector on Ads
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 16:42:02 -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 75758bf9ee Tiles get sparklines and delta chips (CR.tile/sparkline/delta): Reports unique + bots by day, Links 7-day clicks, Ads 7-day hourly views; bar charts capped in width, peak highlight only with 3+ days
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 19:14:37 -05:00
martbost 6091f0b82a Instrument scheme across the Control Room: light workspace on a blueprint grid, dark chrome rail/topbar/status strip, signal-orange primary, gradient charts, corner-bracket tiles, LED readouts, gauges; /api/my/strip
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 19:10:03 -05:00
martbost 274c8fd78c Ads screen in the Control Room shell: buy banner/text/login ads, delivery across viewer, zones and network, earn viewer; login-ad gate after sign-in; member types limited to the three; welcome credits granted from the shell too
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-29 18:11:17 -05:00