Free check partly gated behind joining the network (Marty 2026-11-16)

Not signed in: grade, verdict, first finding and the opinion line; the rest (scores, findings,
chain facts, screenshot, evidence) stays on the server. Join or sign in by one-time email link
(hub /v1/join with the wwi.ref sponsor when HUB_JOIN=1; staging reads only). 1 free check a day
without an account, 3 for members. Red flags deduped (deterministic VERIFIED one kept), grade
recomputed on read. Privacy: joining and emails.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-16 11:36:29 -06:00
parent 5f1a8239f5
commit 47de249a8b
20 changed files with 317 additions and 56 deletions
+3
View File
@@ -19,6 +19,9 @@
return '<tr><td>' + ct(c.created) + '</td><td>' + esc(c.kind) + '</td><td><a href="/c/' + esc(c.id) + '" target="_blank">' + esc(c.website || '') + ' ' + esc(WWI.short(c.address) || '') + ' ' + esc(c.chain || '') + '</a>' + (c.error ? '<br><span style="color:var(--acc2)">' + esc(c.error.slice(0, 160)) + '</span>' : '') + '</td><td>' + esc(c.status) + (c.status !== 'done' ? ' (' + esc(c.step || '') + ')' : '') + '</td><td>' + esc(c.model || '') + '</td><td>$' + Number(c.cost_usd || 0).toFixed(4) + '</td><td>' + (tm ? Math.round(tm.total_s) + ' s' : '') + '</td>'
+ '<td><label><input type="checkbox" data-pub="' + esc(c.id) + '"' + (c.is_public ? ' checked' : '') + '> ' + esc(c.public_label || '') + '</label></td></tr>';
}).join('') + '</tbody></table></div></div>';
h += '<div class="card"><span class="t">Join and sign-in links (no email is sent while MAIL_URL is unset)</span><div class="tblwrap"><table class="t"><thead><tr><th>When</th><th>Email</th><th>Ref</th><th>Opt-in</th><th>Back to</th><th>Status</th><th>Hub</th></tr></thead><tbody>' + (j.joins || []).map(function (x) {
return '<tr><td>' + ct(x.created) + '</td><td>' + esc(x.email) + '</td><td>' + esc(x.ref || '') + '</td><td>' + (x.optin ? 'yes' : 'no') + '</td><td>' + esc(x.to_path || '') + '</td><td>' + esc(x.status) + (x.mailed ? ', mailed' : '') + '</td><td>' + esc(x.hub_result || '') + '</td></tr>';
}).join('') + '</tbody></table></div></div>';
h += '<div class="card"><span class="t">Test purchases and the sponsor line (nothing paid in staging)</span><div class="tblwrap"><table class="t"><thead><tr><th>When</th><th>Buyer</th><th>Item</th><th>Via</th><th>Ref</th><th>Line source</th><th>Would pay</th><th>Company</th></tr></thead><tbody>' + j.purchases.map(function (p) {
var s = p.split || {}; var l = p.line || {};
return '<tr><td>' + ct(p.at) + '</td><td>' + esc(p.buyer_username ? '@' + p.buyer_username : p.buyer || 'visitor') + '</td><td>' + esc(p.item) + ' $' + Number(p.usd).toFixed(2) + '</td><td>' + esc(p.via) + '</td><td>' + esc(p.ref || '') + '</td><td>' + esc(l.source || '') + (l.ok === false ? ' (hub partial)' : '') + '<br><span style="font-size:12px">' + (l.line || []).map(function (x) { return (x.username ? '@' + esc(x.username) : esc(WWI.short(x.wallet) || '?')) + (x.qualified ? ' (bought)' : ' (passed over)'); }).join(' &gt; ') + '</span></td><td>'
+19
View File
@@ -0,0 +1,19 @@
// /join: one email form for joining free and for signing in (a one-time link). Lands back on ?to= (the report that was locked).
(function () {
'use strict';
var $ = WWI.$, q = new URLSearchParams(location.search);
var to = q.get('to') || '/my'; if (!/^\/(?!\/)/.test(to)) to = '/my';
if (q.get('err')) $('msg').textContent = q.get('err');
$('hubBtn').href = '/sso/start?mode=go&to=' + encodeURIComponent(to);
fetch('/api/config').then(function (r) { return r.json(); }).then(function (c) { if (c.member) { $('form').classList.add('hide'); $('msg').innerHTML = 'You are signed in. <a href="' + WWI.esc(to) + '">Continue</a>'; } });
$('form').addEventListener('submit', function (e) {
e.preventDefault(); $('go').disabled = true; $('msg').textContent = '';
WWI.post('/api/join', { email: $('email').value.trim(), optin: $('optin').checked, to: to }).then(function (j) {
$('go').disabled = false;
if (!j.ok) { $('msg').textContent = j.error || 'That did not work. Try again.'; return; }
if (j.mailed) $('msg').textContent = 'Check your inbox: we sent a link that signs you in (or creates your free account). It works for 30 minutes.';
else if (j.testLink) $('msg').innerHTML = 'Staging test address: no email is sent. <a href="' + WWI.esc(j.testLink) + '">Open the sign-in link</a>.';
else $('msg').textContent = j.note || 'No link was sent.';
});
});
})();
+29 -1
View File
@@ -80,6 +80,34 @@ var Render = (function () {
var deep = v.kind === 'deep' && v.report ? '<div style="display:flex;flex-direction:column;gap:16px">' + deepSections(v.report, ex) + '<span class="opinion">' + OPINION + '</span></div>' : '';
return head + '<div class="res-body"><div class="res-main">' + main + '</div><div class="res-side">' + side + '</div></div>' + deep;
}
function draw(el, v) { el.innerHTML = v.status === 'done' ? done(v) : steps(v); }
// not signed in: the server sent only the grade, the verdict, the first finding and counts of what is locked
function gated(v) {
var ex = v.explorer, g = v.grade || {}, L = v.locked || {};
var title = v.address ? WWI.short(v.address) : (v.website || 'Check');
var head = '<div class="res-head"><div style="display:flex;flex-direction:column;gap:6px"><span class="eyebrow">Free check</span>'
+ '<h2 class="sec">' + esc(title) + (v.chainName ? ' <span style="font-weight:500;color:var(--mut)">on ' + esc(v.chainName) + '</span>' : '') + '</h2>'
+ '<span class="mono" style="font-size:14px;color:var(--ink2)">' + (v.address && ex ? '<a class="src" href="' + ex + '/address/' + esc(v.address) + '" target="_blank" rel="noopener nofollow">' + esc(WWI.short(v.address)) + '</a>' : '') + (v.readAt ? ' &middot; read ' + esc(v.readAt.time) + ' &middot; block ' + Number(v.readAt.block).toLocaleString('en-US') : '') + '</span></div>'
+ (g.grade ? '<div class="gradebox ' + gradeCls(g.grade) + '"><div class="g">' + esc(g.grade) + '</div><div class="n">' + (g.forced_by_flag ? 'One critical flag caps the grade at High, whatever the other scores. ' : '') + 'Our opinion, from the published rubric applied to the public facts.</div></div>' : '') + '</div>';
var f = v.report && v.report.top_findings && v.report.top_findings[0];
var first = f ? '<div class="find"><span class="tag ' + esc(f.tag) + '">' + esc(f.tag) + '</span><span>' + link(f.text, ex) + '</span></div>'
: v.firstFact ? '<div class="find"><span class="tag ' + esc(v.firstFact.tag) + '">' + esc(v.firstFact.tag) + '</span><span>' + link(v.firstFact.text, ex) + (v.firstFact.source ? ' <a class="src" style="font-size:13px" href="' + esc(v.firstFact.source) + '" target="_blank" rel="noopener nofollow">source</a>' : '') + '</span></div>' : '';
var items = [];
if (L.scores) items.push(L.scores + ' category scores');
if (L.findings) items.push(L.findings + ' more finding' + (L.findings === 1 ? '' : 's'));
if (L.flags) items.push(L.flags + ' critical flag' + (L.flags === 1 ? '' : 's') + ' explained');
if (L.facts) items.push(L.facts + ' facts read straight from the chain, with sources');
if (L.screenshot) items.push('the website screenshot');
if (L.siteVsCode) items.push('website claims vs code');
var to = '/c/' + v.id;
var main = (v.report && v.report.verdict ? '<div><b>Our verdict (opinion):</b> ' + link(v.report.verdict, ex) + '</div>' : '')
+ (first ? '<div class="finds"><span class="disp" style="font-weight:700;font-size:17px">First finding (public fact)</span>' + first + '</div>' : '')
+ '<span class="opinion">' + OPINION.replace('below', 'in this report') + '</span>';
var lock = '<div class="card dk" style="gap:12px"><span class="disp" style="font-weight:700;font-size:20px">Join free to see the full report: one account across the network</span>'
+ (items.length ? '<span class="b">Still locked: ' + esc(items.join(', ')) + '.</span>' : '')
+ '<span class="b" style="font-size:14px">Joining is free and never asks you to connect a wallet. Members get 3 free checks a day.</span>'
+ '<div style="display:flex;gap:10px;flex-wrap:wrap"><a class="btn org" href="/join?to=' + encodeURIComponent(to) + '">Join free</a><a class="btn line" style="background:transparent;color:var(--on);border-color:var(--on3)" href="/sso/start?mode=go&amp;to=' + encodeURIComponent(to) + '">I am a member: sign in</a></div></div>';
return head + '<div class="res-body"><div class="res-main">' + main + '</div><div class="res-side">' + lock + '</div></div>';
}
function draw(el, v) { el.innerHTML = v.status === 'done' ? (v.gated ? gated(v) : done(v)) : steps(v); }
return { draw: draw, OPINION: OPINION, link: link };
})();