Holding-tank readiness on the tank cards (Marty 2026-11-18, warm-up stage 1, no email)

Each waiting lead on the Holding tank card (/tools) and Admin > Members tank card shows how they got into the tank, a stage chip (New / Warming / Engaged / Activated / Ready, real actions only), the network heat 0-100 with its band, and their last real action, from the network hub (POST /v1/tank/readiness). tankready.js is the same module as InstantAdPay's (entry facts from this site's adoption records, follow records and join data; usernames only). Hottest first inside the usual grace / ready-to-activate groups, a "Warm or hot only" toggle. Hub down = the card as before. No mail, no Telegram, no sponsor moves; adoption rules and caps untouched. qa/tank-readiness.test.mjs in member + tankhold; tankready.js / my.js / admin.js ?v=20261118rd, site.css ?v=ls20261118rd. qa member ALL PASSED.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-18 19:08:51 -06:00
parent 4d22ae72c8
commit 7edc1a25b0
10 changed files with 306 additions and 10 deletions
+7 -2
View File
@@ -35,6 +35,7 @@ const netkb = require('./netkb'); // the shared network KB on the hub; suggest()
const kb = require('./kb'); // the assistant's knowledge base: Admin > Knowledge base, seeded from chatbot.js CANNED + kb-seed.js (2026-10-20)
const coach = require('./coach'); // coaching view, nudges, digest, prospects, link stats
const tank = require('./tank'); // holding tank: unsponsored free members, adoptions, pay-it-forward
const tankready = require('./tankready'); // holding-tank readiness from the network hub (2026-11-18): entry reason, stage, heat, last action on the tank cards. No mail.
const legacy = require('./legacy'); // Faucet Wave / Tier One Ads bridge: welcome-back credits for listed emails
const traffic = require('./traffic'); // public page views by referring domain (admin Traffic tab)
const promos = require('./promos'); // partner promo codes -> free ad credits (link ?promo=CODE or the dashboard box)
@@ -788,6 +789,7 @@ async function boot() {
zonereport.init({ dataDir: DATA_DIR });
snapshot.init({ dataDir: DATA_DIR, db, chain, siteConfig, accounts, rotator, bannerspin, zones, pages, send: async (c, t, th) => { await telegramSend(c, t, th); return true; } });
setInterval(() => snapshot.tick().catch(e => console.error('snapshot', e.message)), 10 * 60 * 1000);
tankready.init({ site: 'linkspin', accounts, tank, followGet: e => followStore.get(e) }); // read-only: sends this site's facts, keeps the hub's answer for the tank cards
tank.init({ capOpen: () => siteConfig().tankAdoptCap, dataDir: DATA_DIR, chain, accounts, messages, mailer, site: SITE_URL, follow, store: followStore,
// network alignment + activation hold + 24-hour safety net (2026-10-27): a tank member's plain activation is never
// bound under the fallback position; their InstantAdPay sponsor first, else an adopter (a purchase is never held)
@@ -1334,6 +1336,7 @@ async function tankAdminAlert(text) {
// tank are announced by InstantAdPay, not twice)
async function tankReadyTick() {
const r = await tank.readyTick();
tankready.refresh().catch(() => {}); // readiness: send the hub this site's entry facts and refresh the card cache (no mail, no sponsor change)
if (r.aligned || r.assigned.length || r.held || r.deferred || r.fresh.length) console.log('tank ready tick', JSON.stringify({ fresh: r.fresh.length, aligned: r.aligned, assigned: r.assigned.length, held: r.held, deferred: r.deferred }));
const sc = siteConfig();
if (!r.fresh.length || !sc.telegramBotToken || !sc.telegramEchoChatId) return r;
@@ -2627,7 +2630,8 @@ const server = http.createServer(async (req, res) => {
if (p === '/api/my/tank' && req.method === 'GET') {
const s = await auth.fromRequest(req);
if (!s || !s.email) return json(res, 401, { error: 'Sign in first.' });
return json(res, 200, await tank.view(s.email));
const v = await tank.view(s.email); v.waiting = await tankready.attach(v.waiting); // readiness (hub): entry, stage, heat, last action
return json(res, 200, v);
}
// -- achievement badge -> Telegram (payments topic + the main group), once per badge per member.
// The browser composes the personalised image (canvas, same as Share) and posts it here.
@@ -2738,7 +2742,8 @@ const server = http.createServer(async (req, res) => {
}
if (p === '/api/admin/tank' && req.method === 'GET') {
if (!isAdmin(req)) return json(res, 401, { error: 'auth' });
return json(res, 200, await tank.adminView());
const v = await tank.adminView(); v.waiting = await tankready.attach(v.waiting); v.readiness = Object.assign(tankready.status(), { counts: tankready.counts() });
return json(res, 200, v);
}
// -- admin Traffic tab: page views + join-page views + signups + $25 buyers, by referring
// domain / first-touch source, by landing page, by angle and by day (Marty, 2026-09-12)