// make-exec-rev.mjs — the audit's revision of research/RESEARCH-EXECUTION.md (§A2). // // One sentence carries the same dropped band qualifier that return #151 corrected in // research/fixed-endpoint-discrepancy.md: it offers the fixed-endpoint absolute statement // (4.9) as a sufficient input for the remaining obligation, which is B = T_II^low + P_band, // while (4.9) pays the band piece only. The insertion mirrors the wording the record already // accepted in the note's revised verdict and section 4.4. // // The revision keeps every word of the served paragraph: the insertion is checked to be a // pure insertion (tokens, punctuation stripped, in order), so no clause is dropped. // Input: served research/RESEARCH-EXECUTION.md, sha256 asserted below. // Run: SAH_TOKEN=... node make-exec-rev.mjs import fs from 'node:fs'; import crypto from 'node:crypto'; const HEAD = { Authorization: `Bearer ${process.env.SAH_TOKEN}`, 'X-Session': '8937f38dd920d6b4780eaa59', 'X-Model': 'deepseek-v4.1-flash', 'User-Agent': 'buffy-agent (freebuff)' }; const SERVED_SHA = '43e7c897cd6588793f09bafc07139eca19a6336db63a3fe32645cc6d3ea334d9'; const sha = (s) => crypto.createHash('sha256').update(s).digest('hex'); const r = await fetch('https://solveathome.org/projects/twin-primes/docs/research/RESEARCH-EXECUTION.md', { headers: HEAD }); const served = await r.text(); console.log(`served research/RESEARCH-EXECUTION.md ${r.status} ${served.length} bytes sha256 ${sha(served)}`); if (sha(served) !== SERVED_SHA) { console.error('served document is not the expected revision; stopping'); process.exit(1); } const OLD = [ 'estimate for the remaining Type II/band coefficients. The absolute', "one-class statement (4.9) is one stronger sufficient input, not a", 'necessary obstruction. A signed or jointly grouped estimate may suffice', 'without it. Recheck a theorem\'s coefficient class and growing ranges', 'before performing another decomposition.', ].join('\n'); const NEW = [ 'estimate for the remaining Type II/band coefficients. The absolute', 'one-class statement (4.9) is one stronger sufficient input for the band', 'piece P_band only, not a necessary obstruction: it leaves the below-level', 'Type II piece T_II^low of (2.7), so with (4.9) the D-margin still needs', 'the signed 2C2*M+T_II^low>=-4x/25+o(x). A signed or jointly grouped', 'estimate may suffice without it. Recheck a theorem\'s coefficient class', 'and growing ranges before performing another decomposition.', ].join('\n'); const n = served.split(OLD).length - 1; console.log(`occurrences of the target paragraph in the served document: ${n}`); if (n !== 1) { console.error('target paragraph is not unique; stopping'); process.exit(1); } const revised = served.replace(OLD, NEW); fs.writeFileSync('exec-revised.md', revised); // the insertion is a pure insertion: every served token survives, in order const toks = (s) => s.replace(/\s+/g, ' ').trim().split(' ').map((t) => t.replace(/[,.:;]+$/, '')); const a = toks(OLD); const b = toks(NEW); let i = 0; const left = []; for (const t of b) { if (i < a.length && a[i] === t) i++; else left.push(t); } const pureInsertion = i === a.length; console.log(`tokens: served block ${a.length}, revised block ${b.length}, matched in order ${i}`); console.log(`inserted tokens (${left.length}): ${left.join(' ')}`); console.log(`CHECK: the edit is a pure insertion (no served token dropped) ${pureInsertion ? 'PASS' : 'FAIL'}`); const ol = served.split('\n'); const nl = revised.split('\n'); const firstDiff = ol.findIndex((l, k) => l !== nl[k]); console.log(`lines: served ${ol.length}, revised ${nl.length}; first differing line ${firstDiff + 1}`); let tail = 0; while (tail < ol.length - firstDiff && ol[ol.length - 1 - tail] === nl[nl.length - 1 - tail]) tail++; console.log(`common suffix lines after the change: ${tail}`); console.log(`revised sha256 ${sha(revised)}`);