Rubric red flag 4 sharpened (Marty 2026-11-16): forced High only when earlier buyers are paid from later buyers' payments; sponsor commissions on a delivered product are disclosed and scored, not auto-flagged

Deterministic payout read (chain/payouts.py): every payout matched to the buyer of the same tx and classed operator /
referral line / earlier buyer outside the line. Earlier-buyer payouts = VERIFIED red flag 4. A model red flag 4 is
INFERRED, must cite evidence, and is not applied when the chain shows only operator and referral-line payouts
(shown on the report as 'Considered and not applied'). Same test for every contract.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
martbost
2026-11-16 12:26:07 -06:00
parent 148eb7ef95
commit 6aeb1b2146
18 changed files with 263 additions and 40 deletions
+34 -9
View File
@@ -43,10 +43,16 @@ Rules you must follow:
- Neutral, factual wording about code and records. You judge code and on-chain records, never people. No advice to act (never tell anyone to join, leave, buy, sell or withdraw).
- Never use these words or phrases: scam, ponzi, rug pull, fraud, guaranteed, get rich, free money, passive income, 100% safe, double your. Never use em dashes or en dashes.
- Wallet wording if needed: "SafePal or any other crypto wallet".
- Scores follow the rubric: 0 = safest, 10 = worst. Anything hidden or unreadable counts against the project, and you say so.`;
- Scores follow the rubric: 0 = safest, 10 = worst. Anything hidden or unreadable counts against the project, and you say so.
- Red flag 4 (returns funded by later entrants) applies ONLY when an earlier buyer or position holder is paid from a later buyer's payment
(matrix, cycler, pot, "previous N spots" paid from new entries, refunds funded by new entries). Read the "Who gets paid when someone buys"
section: it classifies every payout the chain shows. A commission paid to the buyer's sponsor or the sponsors above them on a sale where the
buyer receives a delivered product (ad credits, views, a report) is NOT red flag 4: disclose it (for example "X% of each sale goes to the
buyer's sponsors") and score it under economic design and disclosure on its merits. If a contract does both, red flag 4 applies.
The same test applies to every contract, whoever runs it.`;
const SCORE_SHAPE = `"scores": {"control": {"score": 0-10, "why": "...", "tag": "VERIFIED|INFERRED|UNKNOWN"}, "custody": {...}, "economics": {...}, "insiders": {...}, "disclosure": {...}, "trajectory": {...}},
"critical_flags": ["only red flags from the rubric list that the evidence supports, each one short"]`;
"critical_flags": [{"rule": 1-5 (the rubric red flag number), "text": "one short sentence", "evidence": "the tx hash, address, event or pack line it rests on"}] (only red flags the evidence supports; [] when none)`;
function taskFree(pack, site) {
return `RUBRIC:\n${RUBRIC}\n\nEVIDENCE PACK:\n${pack}\n\n${site ? 'PROJECT WEBSITE (public page text, read by our browser):\n' + site + '\n\n' : ''}Write the FREE CHECK scorecard as JSON with exactly these keys:
@@ -172,22 +178,41 @@ function grade(report, E) {
if (eoaUp.length) flags.push({ text: 'One personal wallet can replace the code in a single transaction (' + eoaUp.join(', ') + ').', tag: 'VERIFIED', source: 'rubric red flag 1' });
const v = (E && E.verification) || {};
if (E && E.proxy && E.proxy.upgradeable && !(v.implementation && v.implementation.match)) flags.push({ text: 'The implementation behind the upgradeable proxy has no verified source on Sourcify.', tag: 'VERIFIED', source: 'rubric red flag 2' });
// red flag 4 (2026-11-16 wording): VERIFIED when the chain shows payouts to earlier buyers outside the buyer's referral line
const pr = (E && E.payout_relations) || null, bc = (pr && pr.by_class) || {};
if (bc.earlier_buyer > 0) {
const x = ((pr.examples || {}).earlier_buyer || [])[0] || {};
flags.push({ text: bc.earlier_buyer + ' payouts went to earlier buyers or position holders outside the buyer\'s referral line, paid inside a later buyer\'s purchase' + (x.tx ? ' (example tx ' + x.tx + ')' : '') + '.', tag: 'VERIFIED', source: 'rubric red flag 4' });
}
// the chain shows only operator and referral-line payouts: a model red flag 4 is not applied (sponsor commissions are disclosed, not flagged).
// Gaps in the history only block this when the code can change (an upgradeable proxy); fixed code pays the same way in every block.
const gapsMatter = !!(E && E.proxy && E.proxy.upgradeable) && (E.gaps || []).some(g => g.what === 'contract events');
const rf4Clear = !!(pr && pr.payouts_seen > 0 && pr.readable && !bc.earlier_buyer && !bc.earlier_buyer_line_unknown && !gapsMatter);
const notApplied = [];
// the model often restates the deterministic red flags: keep one per issue, the deterministic VERIFIED one
const has1 = flags.some(f => f.source === 'rubric red flag 1'), has2 = flags.some(f => f.source === 'rubric red flag 2');
const has1 = flags.some(f => f.source === 'rubric red flag 1'), has2 = flags.some(f => f.source === 'rubric red flag 2'), has4 = flags.some(f => f.source === 'rubric red flag 4');
const words = t => new Set(String(t).toLowerCase().match(/[a-z]{4,}/g) || []);
const similar = (a, b) => { const A = words(a), B = words(b); let n = 0; for (const w of A) if (B.has(w)) n++; return n / Math.max(1, Math.min(A.size, B.size)) >= 0.5; };
const RF4 = /(red flag 4|later (entrants|buyers|entries|purchases)|new (money|entries|entrants|purchases|buyers)|previous \d* ?spots|matrix|cycler|recruit|only (when|inside|from) .{0,40}(purchase|entr|buy)|funded by (new|later))/i;
for (const f of report.critical_flags || []) {
if (typeof f !== 'string' || !f.trim()) continue;
const t = f.trim();
if (has1 && /(upgrad|replace (the )?code|single[- ](eoa|wallet|key)|one (personal )?wallet|\beoa\b|owner key)/i.test(t)) continue;
if (has2 && /(unverified|not verified|no verified|source)/i.test(t)) continue;
const o = typeof f === 'string' ? { text: f } : (f && typeof f === 'object' ? f : null);
if (!o || typeof o.text !== 'string' || !o.text.trim()) continue;
const t = o.text.trim(), ev = typeof o.evidence === 'string' ? o.evidence.trim() : '';
const rule = Number(o.rule) || (RF4.test(t) ? 4 : 0);
if (has1 && (rule === 1 || /(upgrad|replace (the )?code|single[- ](eoa|wallet|key)|one (personal )?wallet|\beoa\b|owner key)/i.test(t))) continue;
if (has2 && (rule === 2 || /(unverified|not verified|no verified|source)/i.test(t))) continue;
if (rule === 4) {
if (has4) continue;
if (rf4Clear) { notApplied.push({ text: t, reason: 'Red flag 4 not applied: of ' + pr.payouts_seen + ' payouts read, ' + (bc.operator || 0) + ' went to wallets the contract names and ' + (bc.referral_line || 0) + ' to the buyer\'s referral line, and none to an earlier buyer outside that line. Sponsor commissions are disclosed and scored under economic design (rubric 2026-11-16).' }); continue; }
if (typeof f === 'object' && !ev) { notApplied.push({ text: t, reason: 'Red flag 4 not applied: the model cited no evidence.' }); continue; }
}
if (flags.some(x => similar(x.text, t))) continue;
flags.push({ text: t, tag: 'INFERRED', source: 'model, from the rubric list' });
flags.push({ text: t + (ev && !t.includes(ev) ? ' (evidence: ' + ev + ')' : ''), tag: 'INFERRED', source: 'model, from the rubric list' + (rule ? ' (red flag ' + rule + ')' : '') });
}
let band = overall == null ? null : overall <= 25 ? 'Low risk' : overall <= 50 ? 'Moderate risk' : overall <= 75 ? 'Elevated risk' : 'High risk';
const forced = flags.length > 0 && band !== 'High risk';
if (flags.length) band = 'High risk';
return { overall, grade: band, forced_by_flag: forced, flags };
return { overall, grade: band, forced_by_flag: forced, flags, not_applied: notApplied };
}
const TAGS = new Set(['VERIFIED', 'INFERRED', 'UNKNOWN']);
function normalize(report) {