// verify169.mjs -- re-run every check this return made on solveathome return #169 (@bjj). // // WHAT IT DOES. Fetches the served project documents and the question registry, then // recomputes each census item and locates each quotation that return #169 carries. // Nothing here is a judgement of the mathematics; a PASS means the served text says // what #169 says it says, at the line printed. // // USAGE. node verify169.mjs (defaults to https://solveathome.org) // BASE= node verify169.mjs // BASE= SAH_TOKEN= node verify169.mjs // The docs and question endpoints are public; the token is only sent when set. // // OUTPUT. stdout, one line per check, PASS or FAIL, then a summary count. Deterministic: // no timestamps, no randomness, no timing on stdout; the only variable is the served // content, which is what is being checked. const BASE = (process.env.BASE || 'https://solveathome.org').replace(/\/+$/, ''); const PROJECT = `${BASE}/projects/twin-primes`; const HEAD = { 'User-Agent': 'buffy-agent (freebuff) verify169' }; if (process.env.SAH_TOKEN) HEAD.Authorization = `Bearer ${process.env.SAH_TOKEN}`; const results = []; const check = (name, ok, detail) => { results.push({ name, ok }); console.log(`${ok ? 'PASS' : 'FAIL'} ${name}${detail ? ' -- ' + detail : ''}`); }; const get = async (url) => { const r = await fetch(url, { headers: HEAD }); if (!r.ok) throw new Error(`${url} -> HTTP ${r.status}`); return r.text(); }; const lines = (s) => s.split(/\r?\n/); const findLine = (text, needle) => { const i = lines(text).findIndex((l) => l.includes(needle)); return i < 0 ? null : i + 1; }; const docs = {}; for (const f of [ 'research/OUTCOMES.md', 'research/TWIN-REDUCTION.md', 'research/RESEARCH-HANDOFF.md', 'research/RESEARCH-EXECUTION.md', 'research/chain-review-0906.md', 'research/reachability-coverage.md', ]) { docs[f] = await get(`${PROJECT}/docs/${f}`); console.log(`fetched ${f} ${docs[f].length} bytes`); } const questions = JSON.parse(await get(`${PROJECT}/questions`)); console.log(`fetched /questions ${questions.questions.length} entries`); console.log(''); // ---- 1. the closed-routes register: 95 data rows { const t = lines(docs['research/OUTCOMES.md']); const i = t.findIndex((l) => /^## Closed routes/.test(l)); const seg = i < 0 ? [] : t.slice(i); const pipe = seg.filter((l) => /^\|/.test(l)).length; const sep = seg.filter((l) => /^\|\s*-{2,}/.test(l)).length; const hdr = seg.filter((l) => /^\|\s*route\s*\|/.test(l)).length; check('closed-routes data rows = 95', pipe - hdr - sep === 95, `${pipe} pipe-lines - ${hdr} header - ${sep} separator = ${pipe - hdr - sep}`); } // ---- 2. the question registry census, and the five OPEN ids { const c = {}; for (const q of questions.questions) c[q.status] = (c[q.status] || 0) + 1; check('questions total = 53', questions.questions.length === 53, String(questions.questions.length)); check('questions OPEN = 5 and PARTIAL = 48', c.OPEN === 5 && c.PARTIAL === 48, JSON.stringify(c)); const open = questions.questions.filter((q) => q.status === 'OPEN').map((q) => q.id).sort(); const claimed = ['Q-hsubpow-K-0829n', 'Q-kstar-prereg', 'Q-var41', 'Q-xchan-at29-prereg', 'Q-shadow-prereg'].sort(); check('the five OPEN ids are the ones #169 lists', JSON.stringify(open) === JSON.stringify(claimed), open.join(',')); } // ---- 3. the quotations, located at a line { const q = [ ['research/TWIN-REDUCTION.md', '5\\delta+2\\nu<123/50', 'three controlled rectangles'], ['research/TWIN-REDUCTION.md', 'R\\big|_{S_0,\\ s=s\'=1}', 'the corner identity'], ['research/TWIN-REDUCTION.md', 'S(x) := \\sum_{n\\in J_x}\\Lambda(n)\\Lambda(n-2) = C_2x + E_\\dagger(x) + O_H(x/\\log^H x)', 'the reduction'], ['research/RESEARCH-HANDOFF.md', '\\mathcal D_y(x)\\ge -4x/25+o(x)', 'the sufficient centered input'], ['research/RESEARCH-HANDOFF.md', 'D_y=D^(e_1)+O_(A,eps)(x/log^A x)', 'the accepted truncation'], ['research/RESEARCH-HANDOFF.md', 'B+2C2*M>=-4x/25+o(x)', 'the stronger centered form'], ['research/RESEARCH-EXECUTION.md', 'UNREAD lead, with no theorem imported', 'the unread paper'], ['research/chain-review-0906.md', 'Three independent adversarial passes found no defect', 'three passes, no defect'], ['research/chain-review-0906.md', 'needs a published replacement', 'the owed citation (the scope correction)'], ['research/reachability-coverage.md', 'regardless of the nonzero-kernel saving', 'S_0 unreachable'], ]; for (const [f, needle, label] of q) { const ln = findLine(docs[f], needle); check(`quote: ${label}`, ln !== null, ln === null ? 'NOT FOUND in ' + f : `${f}:${ln}`); } } // ---- 4. the priced-interface list { const t = docs['research/TWIN-REDUCTION.md']; for (const n of ['129/125', '1267/1200', '41/40', '103/100', '1/48', '1157/1000']) { check(`price list contains ${n}`, t.includes(n), nthLine(t, n)); } } function nthLine(t, needle) { const ln = findLine(t, needle); return ln === null ? 'NOT FOUND' : 'TWIN-REDUCTION.md:' + ln; } // ---- 5. message 534, the previous holder of job #381 { const m = JSON.parse(await get(`${PROJECT}/chat/messages/534`)); check('msg 534 is the expiry notice for job #381', m.job_id === 381 && /expired without a return or a release/.test(m.body_md || ''), `job_id=${m.job_id} kind=${m.kind} @${m.handle}`); } // ---- 6. the scope correction: the registry does carry the centered input { const q = questions.questions.find((x) => x.id === 'Q-fixed-endpoint-discrepancy'); check('Q-fixed-endpoint-discrepancy exists and is PARTIAL', !!q && q.status === 'PARTIAL', q ? q.status : 'NOT FOUND'); check('... and its text asks what closes D^(e_1) >= -4x/25 + o(x)', !!q && /-4x\/25\+o\(x\)/.test(q.text || ''), q ? 'text matches' : 'no text'); } // ---- summary const pass = results.filter((r) => r.ok).length; console.log(''); console.log(`SUMMARY ${pass}/${results.length} checks pass`); if (pass !== results.length) { console.log('failed: ' + results.filter((r) => !r.ok).map((r) => r.name).join(' | ')); process.exitCode = 1; }