From 86b60f493c793fce221d5e0eb30d13e5b791efd8 Mon Sep 17 00:00:00 2001 From: martbost Date: Thu, 29 Oct 2026 10:51:46 -0500 Subject: [PATCH] Traffic guide rendered empty since 2026-10-28: a // comment inside the network filter one-liner swallowed the return and the closing brackets, so traffic-guide.js failed to parse (Marty saw it on his phone 2026-10-29). Comment moved out, ?v=20261029b. QA: node --check syntax gate on every script in every run.sh mode; /traffic-guide, /refuel and /conversion-tracking added to the public walk Co-Authored-By: Claude Fable 5.1 --- public/assets/traffic-guide.js | 3 ++- public/traffic-guide.html | 2 +- qa/run.sh | 13 +++++++++++++ qa/walk.mjs | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/public/assets/traffic-guide.js b/public/assets/traffic-guide.js index 17786c0..5df01b6 100644 --- a/public/assets/traffic-guide.js +++ b/public/assets/traffic-guide.js @@ -21,7 +21,8 @@ const rows = Object.keys(o.fit).sort((a, b) => ORDER.indexOf(o.fit[a][0]) - ORDER.indexOf(o.fit[b][0])); const good = rows.filter(f => o.fit[f][0] === 'best' || o.fit[f][0] === 'good'); // networks that sell at least one best/good format; strict-policy networks are left out for the opportunity offer - const nets = Object.keys(G.NETWORKS).filter(k => { const n = G.NETWORKS[k]; if (n.strict && o.key === 'opp') return false; if (n.adult === 'adult' && !['games', 'sweeps'].includes(o.key)) return false; // adult-only sites suit few offers return n.f.some(f => good.includes(f)); }) + // adult-only sites suit few offers + const nets = Object.keys(G.NETWORKS).filter(k => { const n = G.NETWORKS[k]; if (n.strict && o.key === 'opp') return false; if (n.adult === 'adult' && !['games', 'sweeps'].includes(o.key)) return false; return n.f.some(f => good.includes(f)); }) .map(k => ({ k, score: G.NETWORKS[k].f.reduce((s, f) => s + (o.fit[f] ? (o.fit[f][0] === 'best' ? 3 : o.fit[f][0] === 'good' ? 1 : 0) : 0), 0) })) .sort((a, b) => b.score - a.score || nameOf(a.k).localeCompare(nameOf(b.k))); $('result').innerHTML = '
' diff --git a/public/traffic-guide.html b/public/traffic-guide.html index 72c819d..ca93dca 100644 --- a/public/traffic-guide.html +++ b/public/traffic-guide.html @@ -65,6 +65,6 @@
- + diff --git a/qa/run.sh b/qa/run.sh index 16c019c..62e94f6 100644 --- a/qa/run.sh +++ b/qa/run.sh @@ -36,6 +36,19 @@ stop_local() { # $1 = port rm -rf "$TMP-$1" } +# Syntax gate, every mode (2026-10-29): /traffic-guide shipped with a parse error in traffic-guide.js (a // comment inside a +# one-liner) and rendered empty for everyone for a day. node --check costs nothing and catches it before any walk runs. +syntax_gate() { + local bad=0 f + for f in *.js lib/*.js public/*.js public/assets/*.js; do + [ -f "$f" ] || continue + node --check "$f" 2>"$OUT/syntax.err" || { echo "[bug] SYNTAX $f :: $(grep -m1 -E 'Error' "$OUT/syntax.err")"; bad=1; } + done + rm -f "$OUT/syntax.err" + [ "$bad" = 0 ] && echo "syntax gate: every script parses" || status=1 +} +syntax_gate + if [ "$MODE" = "public" ]; then node qa/walk.mjs public || status=1 elif [ "$MODE" = "fuel" ]; then diff --git a/qa/walk.mjs b/qa/walk.mjs index ba14934..468c264 100644 --- a/qa/walk.mjs +++ b/qa/walk.mjs @@ -60,7 +60,7 @@ if (MODE === 'public' || MODE === 'all') { const page = await ctx.newPage(); const bag = watch(page, LIVE); const PUBLIC = ['/', '/ledger', '/contract', '/terms', '/privacy', '/disclaimer', '/wall/martbost', '/join/martbost', '/join/martbost?v=instant', '/join/martbost?v=adspend', '/join/martbost?v=free', '/join/martbost?v=ledger', '/join/martbost?v=two', - '/admin', '/my', '/shorts', '/nope-404']; + '/traffic-guide', '/refuel', '/conversion-tracking', '/admin', '/my', '/shorts', '/nope-404']; for (const p of PUBLIC) { const label = 'LIVE ' + p; try {