Commit Graph

113 Commits

Author SHA1 Message Date
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 32c85c4fae Merge Banner Spin phases 3-4
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:50:02 -05:00
martbost f404749fb0 Banner health: a size mismatch is a warning, not an auto-pause (the builder allows it)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:50:00 -05:00
martbost d9342d8141 Banner Spin phase 4: chatbot, training lesson, promo tools, release note draft, QA
- chatbot.js: canned Banner Spin answer (ahead of the ad-edit and spin-link answers) + FACTS (what it is, tiers, embeds, matching, Gmail and paid-network limits, reports, health); KNOWLEDGE_DATE 2026-10-20.
- Training: catalog/training.json ships a written Banner Spin lesson, appended to /api/training unless the volume list has the same id; lesson text keeps its paragraphs (pre-line).
- Promo tools: "What is Banner Spin?" in the objection bank + an X post.
- docs/release-drafts/2026-10-20-banner-spin.json: release note in the releases store shape, NOT published.
- qa/bannerspin.mjs: health auto-pause/resume with a corrupted upload, a dead target and the last-live rule; winner; bots/servers apart; caches flag; source postback; Reports API + screen; admin switch button; chatbot; training; promo; draft. 75/75.
- Cache tags bumped: banner-spin.js, reports.js, admin.js, my.js, promo.js (20261020bs3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:39:52 -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 693a539503 Speed (same fixes as InstantAdPay): catalog reads in parallel + stale-while-revalidate /api/catalog, positions read side by side, member reads cached 15 s (cleared on every new chain event)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 05:21:48 -05:00
martbost a9994e708d Qualified Start help: every Add-a-position step logged (browser stages + server answers, DATA_DIR/position-attempts.json, admin GET /api/admin/position-attempts?email=), a 20 s 'waiting on your wallet' tip when MetaMask stays silent, and Buy from always shown once a main wallet is linked
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 04:23:05 -05:00
martbost 2aef2c4b83 Merge ad editing (one free correction per ad, then campaignEditFee credits)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:25:15 -05:00
martbost d05d5527c5 Ad image check: a host that is slow or blocks the checker gives a warning, not a refusal (only a too-big file or a missing upload refuses)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 19:24:59 -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 77c2037dee Pages: centre every CTA button (the body button sat left under the copy); split hero keeps its button with the text on desktop and centres it on phones
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 17:19:35 -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 c2e5a0f6f1 Merge Banner Spin phases 1 and 2
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:59:45 -05:00
martbost 29c24461dc Chain index keeps the full event history (KEEP_EVENTS 600 -> 250000): own-buy checks for the holding tank and Banner Spin tiers, earnings and the ledger read it as all events
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:59:45 -05:00
martbost 1d1740c7f9 Banner Spin builder (phase 2) on the Links screen: Spin links / Banner Spins switch, New Banner Spin (size, fallback), uploads with real-size preview and size / 150 KB checks, targets (page or own spin link), weights, mode, hours, pause, fallback image, source, four copy-ready embeds, Gmail + paid-network notes, tier limits shown, simple stats by banner and placement; qa/bannerspin.mjs end-to-end test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 10:58:45 -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 e0e0bde1f9 Mail: the first non-code email to each address opens with a short 'what LinkSpin is' intro (once per address, mail-intro.json)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 08:43:53 -05:00
martbost 7b63e75986 Badges: member name moves to the clear band under the art's text (it overlapped ACHIEVEMENT UNLOCKED); long names shrink to fit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 07:33:30 -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 f4b3058a58 Ledger and Telegram name linked positions as '<owner> (position)' instead of a bare member number
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 06:56:23 -05:00
martbost a416f2f9c9 Member numbers saved at every engine activation + one-time backfill from the chain (340 activated accounts had none, so the live ledger showed member numbers instead of usernames)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 06:41:12 -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 f875d94d51 Ads viewer: "View an ad" no longer says "no member ads" on every second press
The viewer alternates banner/text requests; with only one type live, every other
press came back empty. /api/my/earnview now treats the type as a preference and
falls back to the other type before answering none.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 05:15:14 -05:00
martbost 724dafd9be Restore CRLF line endings (no content change)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:45:25 -05:00
martbost 36611218ad Payouts switch on automatically when a wallet is linked (wallet screen, wallet sign-in, InstantAdPay sync): engine activateFor, gas on us, sponsors first; quiet in-app notice, email held by the pre-launch gate
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 18:44:00 -05:00
martbost 4743c7f8a9 Pre-launch open: notice on every Control Room screen (testing until November 15, live but subject to change); chatbot knows it
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 17:06:50 -05:00
martbost 3a7934df00 Pre-launch: mail gate LS_MAIL_MODE (default codes-only: only sign-in codes go out, everything else held and logged); holding-tank rescue sweep OFF unless TANK_RESCUE=on (it warned 274 sponsors of carried-over members and would have moved their referrals)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 16:59:48 -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 3ac8cf3cd0 Traffic sources: Froggy Ads template ([CLICK_ID] macros and rtb.adx1.com postback, read from their campaign form)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 15:06:06 -05:00
martbost 2e026e1a42 Reverse registry sync: push LinkSpin-first members to InstantAdPay (iapsync.js)
Mirror of InstantAdPay's lssync: touch() on account create / username / wallet (incl. admin set) / sponsor / profile
via a new accounts.onChange hook, plus a 2-minute hashed tick, 100 rows per signed POST to IAP_URL/api/partner/registry
with the same LS_SYNC_SECRET. Inert while the secret is missing or short.

Loop guard (documented in the module header): only rows changed since our last push, and never rows the registry
already holds (= what InstantAdPay told us), so the accounts built from the InstantAdPay import are recorded and not
sent. A pushed LinkSpin-first email gets a registry row with firstProperty 'linkspin', and registry.upsert no longer
overwrites an existing firstProperty, so InstantAdPay's echo cannot relabel it.

Also: the inbound InstantAdPay handler binds sponsors in a second pass, so a row that precedes its sponsor's row in the
same batch (newest-first order) is no longer left without a sponsor. Admin: GET /api/admin/iapsync, POST .../run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 10:44:54 -05:00
martbost baa7db61ff Message kinds from InstantAdPay (broadcast / alert / notice): carry-over notices are quiet inbox notices, never the sign-in modal; a one-time startup pass reclassifies the ones already stored
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:42:31 -05:00
martbost 19bb98eabc Join notice: no 3-day window wording; purchases never wait
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:20:15 -05:00
martbost 3a359974c8 LinkSpin: no default no-payout ids (the IAP #25 entry blocked LinkSpin's own member #25)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:04:28 -05:00
martbost 080cf703f1 Engine activation: rotate RPC providers, re-read the chain after any error before calling it a failure; seed sends the missed notice to members activated during the 403 run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 08:02:15 -05:00
martbost 732a3a0378 Pre-seed: notice says payouts were switched on for you (not 'someone was about to buy'); seedAll skips members already on-chain and reports them
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 07:59:56 -05:00
martbost 4a432975b0 Never hold a purchase: the 3-day claim window is gone. A sponsor with a wallet is activated by the engine (one retry); no wallet, unknown sponsor or a failed activation walks up to the nearest ancestor with a wallet, else the company. Only the buy (intent=buy) moves the member and sends notices; /api/me and /api/sponsor block only on an RPC hiccup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 07:55:31 -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 1f6048a650 Catalog: PropellerAds macros corrected from the live campaign form ({zone_id} {campaign_id} {banner_id}, plus {cost} and {country})
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 06:40:12 -05:00
martbost beaf040833 Catalog: PropellerAds pid slot is optional (its postback ships with pid empty; the create form refused the template)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-13 08:02:55 -05:00
martbost f22593a2dc RPC breaker: bench a provider only for health failures (timeouts, connection errors, rate limits, 5xx); request errors such as invalid block range just move to the next provider
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 11:40:19 -05:00
martbost a37ac0b749 RPC circuit breaker for LinkSpin: bench a failing provider for 10 min, 4 s timeout on eth_call, log provider failures; log any request over 3 s
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 11:30:13 -05:00
martbost c2178b4c6e Traffic-source catalog lives in catalog/ (DATA_DIR=/app/data is the runtime volume in production and would hide a shipped file)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-12 11:18:08 -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 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