Network Weekend (Marty 2026-11-17): Boost views from the live VABShop SKU on every page, quote and chatbot, the network ribbon

chainskus.js reads skus(1) every 60 s and keeps C.boost in step (BOOST_VIEWS stays the normal 500 as normalViews), so a $5
Boost shows 750 once the owner signs setSku and 500 before or after; crediting already follows the Purchase event's views.
common.js rewrites the pages' static '500 guaranteed views' copy to the live number only when the chain differs.
weekend.js: the Fri 11-27 00:00 CT to Tue 12-01 00:00 CT gate (WEEKEND_NOW test clock) for the dated chatbot fact; the ribbon
line (netdeals.setLocal) only exists while the chain really holds the weekend Boost. chatcore render hook, live intro.
qa/weekend.test.mjs 18 pass, chatbot 206, smoke 197. common.js?v=9.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-17 07:39:47 -06:00
parent c4bdefb8a0
commit b062939577
21 changed files with 292 additions and 21 deletions
+5 -3
View File
@@ -28,6 +28,8 @@ function key() {
try { return fs.readFileSync(path.join(S.dataDir, 'openrouter.key'), 'utf8').trim(); } catch (e) { return ''; }
}
const enabled = () => !!key();
// optional per-site rewrite of an instant answer at answer time (2026-11-17, Network Weekend: live chain numbers and dated deals)
const R = t => { try { return S && typeof S.render === 'function' ? S.render(t) : t; } catch (e) { return t; } };
// CANNED + FAQ in the shape kb.js stores (order keeps the first-match-wins sequence)
function seeds() {
@@ -129,14 +131,14 @@ async function answerRaw(message, historyText) {
if (hit && other.length && !hit.handoff) hit = null;
} catch (e) { kbOk = false; console.error('kb fast path', e.message); }
// a hand-off (support, one person's account problem) always answers from its exact pattern, before anything else
if (hit && hit.handoff) return { reply: hit.answer, canned: true, kb: hit.id, handoff: true };
if (hit && hit.handoff) return { reply: R(hit.answer), canned: true, kb: hit.id, handoff: true };
// then meaning (2026-11-16, netkb.route): the hub's semantic match over the network KB answers, keeps or overrules the
// pattern hit, and picks the prompt context. Hub or model slow or down: null, and the pattern + BM25 path below runs as before.
let sem = null;
if (kbOk) { try { sem = await netkb.route(msg, { fast: hit, own: await kb.own(), prefer: other }); } catch (e) { sem = null; } }
if (sem) hit = sem.hit;
if (hit) return Object.assign({ reply: hit.answer, canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: c.a, canned: true }, c.handoff ? { handoff: true } : {});
if (hit) return Object.assign({ reply: R(hit.answer), canned: true, kb: hit.id }, sem ? { via: sem.via } : {}, hit.handoff ? { handoff: true } : {});
if (!kbOk) for (const c of S.canned) if (c.re && c.re.test(msg)) return Object.assign({ reply: R(c.a), canned: true }, c.handoff ? { handoff: true } : {});
let kbBlock = '', kbIds = [], hits = [];
try {
const query = msg.split(/\s+/).length < 4 && historyText ? msg + ' ' + String(historyText).slice(-200) : msg;