chore: final state before the move to gart/gart-databases

Commits the work done since 2026-10-01 that was still local: the four-step
label and flag passes, the triage and recheck files, the v1 exports of
2026-10-06 and 2026-10-07, the split dossiers, and the Lopp PR 234 batch
(scripts, agent prompts, reader and checker files, the flag re-read of
2026-10-17, the review workbook and the import set of the 57 cases added
to stats2 as 506 to 562). Raw HTML and node_modules stay out (.gitignore).

The stats2 material in use was copied to gart/gart-databases (stats2/) on
2026-10-17; README-START-HERE.md now says so. This repo is closed.
This commit is contained in:
StellarCrow
2026-10-17 10:47:37 +02:00
parent 0f7a691151
commit 41766c68a2
3196 changed files with 374809 additions and 485 deletions
+45
View File
@@ -0,0 +1,45 @@
// Field comparison for the cases verified by the older method (summary and sequence done,
// record fields never compared with the articles). Prepares batches of ten:
// batches/compare-NN.in.json summary, sequence, attempted, gaps, rationale as they stand
// batches/batch-lists.json gains the new batch numbers
// The writer adds flags, contradictions, facts and notes and writes batches/batch-NN.json.
// bun compare_prepare.ts prepare bun compare_prepare.ts check
import { existsSync, readFileSync, readdirSync, writeFileSync } from "fs";
const J = (p: string) => JSON.parse(readFileSync(p, "utf8"));
const FIRST = 36;
const KEEP = ["summary", "sequence", "attempted", "gaps", "v1_label_supported", "rationale"];
const cmd = process.argv[2];
if (cmd === "prepare") {
const seqs = J("scenario-sequences.json"), summaries = J("summary-overrides.json");
const lists = J("batches/batch-lists.json");
const ids = Object.keys(seqs).filter((k) => !("facts" in seqs[k])).map(Number).sort((a, b) => a - b);
for (let i = 0; i * 10 < ids.length; i++) {
const nn = String(FIRST + i);
const part = ids.slice(i * 10, (i + 1) * 10);
lists[nn] = part;
writeFileSync(`batches/compare-${nn}.in.json`, JSON.stringify(part.map((id) => ({
id, dossier: `sources/${readdirSync("sources").find((f) => f.startsWith(String(id).padStart(3, "0") + "_"))}`,
summary: summaries[id], sequence: seqs[id].sequence, attempted: seqs[id].attempted, gaps: seqs[id].gaps,
v1_label_supported: seqs[id].v1_label_supported, rationale: seqs[id].rationale,
})), null, 1));
}
writeFileSync("batches/batch-lists.json", JSON.stringify(lists, null, 1));
console.log(`${ids.length} cases in batches ${FIRST} to ${FIRST + Math.ceil(ids.length / 10) - 1}`);
} else if (cmd === "check") {
// the fields that were already verified must come back unchanged
let bad = 0, done = 0;
for (const f of readdirSync("batches").filter((f) => /^compare-\d+\.in\.json$/.test(f)).sort()) {
const nn = f.slice(8, 10);
if (!existsSync(`batches/batch-${nn}.json`)) { console.log(`batch-${nn}.json missing`); bad++; continue; }
const out = new Map<number, any>(J(`batches/batch-${nn}.json`).map((c: any) => [c.id, c]));
for (const c of J(`batches/${f}`)) {
const o = out.get(c.id);
if (!o) { console.log(`batch-${nn} case ${c.id}: missing`); bad++; continue; }
done++;
for (const k of KEEP) if (JSON.stringify(o[k]) !== JSON.stringify(c[k])) { console.log(`batch-${nn} case ${c.id}: ${k} was changed`); bad++; }
}
}
console.log(`${done} cases checked, ${bad} problems`);
if (bad) process.exit(1);
} else throw new Error("usage: bun compare_prepare.ts prepare | check");