Coach nudges never guess from a failed chain read, and the site owner is never coached (Marty 2026-10-31): a chain.member() failure cached null for 60 s, rungFor() then classed the member as "payouts on, no purchase" and mailed the rung-2 "See a payout land: your first package" nudge to the owner (memberId 1, 4 purchases, 7 buyers). describe() now reports unknown and stalled requires a known state; nudgeTick skips adminEmail.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -56,12 +56,16 @@ async function member(id) {
|
||||
const STALL_DAYS = 3;
|
||||
async function describe(acct, now = Date.now()) {
|
||||
const mm = await member(acct.memberId);
|
||||
// unknown = the member is on chain but the read failed just now (member() swallows RPC errors and caches null for a
|
||||
// minute); rungFor would call them "payouts on, no purchase" and the coach would mail a buyer the first-package nudge
|
||||
// (2026-10-31 on LinkSpin: Marty, 4 purchases and 7 buyers, got "See a payout land"). Callers that mail must skip unknown.
|
||||
const unknown = !!(acct.memberId && !mm);
|
||||
const rung = rungFor(acct, mm);
|
||||
const last = Math.max(acct.created || 0, acct.lastSeen || 0);
|
||||
const quietDays = Math.floor((now - last) / DAY);
|
||||
const stalled = rung < 6 && quietDays >= STALL_DAYS;
|
||||
const stalled = !unknown && rung < 6 && quietDays >= STALL_DAYS;
|
||||
const R = RUNGS[rung];
|
||||
return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, buyerCount: mm ? mm.buyerCount : 0,
|
||||
return { rung, label: R.label, next: R.next, say: R.say, quietDays, stalled, unknown, buyerCount: mm ? mm.buyerCount : 0,
|
||||
counted: !!(mm && mm.countedAsBuyer), joined: acct.created, lastSeen: acct.lastSeen || 0, onchainSponsorId: mm ? mm.sponsorId : null };
|
||||
}
|
||||
// coaching view for a sponsor: every direct, ladder rung, stalled flag, what to say
|
||||
@@ -320,6 +324,7 @@ async function nudgeTick() {
|
||||
const all = await accounts.listAll(5000);
|
||||
for (const acct of all) {
|
||||
if (!acct.email || !acct.created || now - acct.created < STALL_DAYS * DAY) continue;
|
||||
if (X.adminEmail && String(acct.email).toLowerCase() === String(X.adminEmail).toLowerCase()) continue; // the site owner is never coached (2026-10-31)
|
||||
const c = await describe(acct, now);
|
||||
if (!c.stalled) continue;
|
||||
const R = RUNGS[c.rung]; if (!R.mail) continue;
|
||||
|
||||
Reference in New Issue
Block a user