| 88 | } |
| 89 | |
| 90 | export function writeNumericFailures(stage2: Stage2Report): string { |
| 91 | const file = path.join(OUT_DIR, 'numeric-failures.json'); |
| 92 | const payload = { |
| 93 | generated: new Date().toISOString(), |
| 94 | seed: stage2.seed, |
| 95 | slice: stage2.slice, |
| 96 | falseEntryCount: stage2.falseEntries.length, |
| 97 | entries: stage2.falseEntries |
| 98 | .map((e) => ({ |
| 99 | id: e.id, |
| 100 | topic: e.topic, |
| 101 | class: e.class, |
| 102 | guardLevel: e.guardLevel, |
| 103 | instances: e.instances |
| 104 | .filter((i) => i.outcome === 'False') |
| 105 | .map((i) => ({ assignment: i.assignment, detail: i.detail })), |
| 106 | })) |
| 107 | .sort((a, b) => a.id.localeCompare(b.id)), |
| 108 | }; |
| 109 | fs.writeFileSync(file, JSON.stringify(payload, null, 2) + '\n'); |
| 110 | return file; |
| 111 | } |
| 112 | |
| 113 | export function printStage1Summary(report: Stage1Report): void { |
| 114 | const pct = (x: number) => `${(100 * x).toFixed(2)}%`; |