Archived
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.
18 lines
1.3 KiB
TypeScript
18 lines
1.3 KiB
TypeScript
// Lists the keys whose check rejected a text field or the page cuts, and writes fix batches of 15:
|
|
// batches/fix-NN.json. bun fixlist.ts
|
|
import { existsSync, readdirSync, readFileSync, writeFileSync } from "fs";
|
|
import { join } from "path";
|
|
const HERE = import.meta.dir;
|
|
const TEXT = ["summary", "description", "case_details"];
|
|
const queued = new Set(readdirSync(join(HERE, "batches")).filter((f) => f.startsWith("fix-")).flatMap((f) => JSON.parse(readFileSync(join(HERE, "batches", f), "utf8"))));
|
|
const keys: string[] = [];
|
|
for (const f of readdirSync(join(HERE, "work/check")).sort()) {
|
|
const c = JSON.parse(readFileSync(join(HERE, "work/check", f), "utf8"));
|
|
const key = f.replace(/\.json$/, "");
|
|
if (existsSync(join(HERE, "work/fix", f)) || queued.has(key)) continue;
|
|
if (c.pages_verdict === "reject" || TEXT.some((t) => c.verdicts?.[t] === "reject")) keys.push(key);
|
|
}
|
|
const start = readdirSync(join(HERE, "batches")).filter((f) => f.startsWith("fix-")).length;
|
|
for (let i = 0; i < keys.length; i += 15) writeFileSync(join(HERE, "batches", `fix-${String(start + i / 15 + 1).padStart(2, "0")}.json`), JSON.stringify(keys.slice(i, i + 15)));
|
|
console.log(`${keys.length} keys to fix in ${Math.ceil(keys.length / 15)} batches, numbered from fix-${String(start + 1).padStart(2, "0")}`);
|