The results table
A tool E-2 builds on the Records API: the table its report rests on, built from the files one night's check kept, counting a run only by E-2's rules, with the history file behind each row named so the lab can check any row.
E-2's report says what model M-12 could do: which tasks it solved, in how many runs, and how long each took. The numbers come from a table, and the table is the part of the report a lab presses on. So E-2 builds it from the record. A row is a run whose record passed, whose result file is the one the record names, and that no reviewer set aside. Each row names the history file it came from, so the lab can check the row itself.
E-2's rules for a run to count
These rules are E-2's, written in its tool. PacSpace has no say in them.
- The run's record passed the night's check.
- The record has a
run-endentry, and the result file E-2 holds is the one that entry names. - No reviewer set the run aside. A run with a monitor flag counts only once a reviewer says it does.
The code
The table reads one night's folder from the nightly check, and nothing else from PacSpace. Every row comes from files the lab gets too.
import { existsSync } from 'node:fs';
import { readFile, writeFile } from 'node:fs/promises';
import type { RecordHistory } from '@pacspace-io/sdk';
import type { CheckReport } from '@pacspace-io/check';
import { rowsOf } from './record-rows';
// The night whose history files go to the lab with the report.
const night = '2026-10-28';
const folder = `checks/${night}`;
async function load(record: string) {
if (!existsSync(`${folder}/${record}.history.json`)) return null;
const history: RecordHistory = JSON.parse(await readFile(`${folder}/${record}.history.json`, 'utf8'));
const report: CheckReport | null = JSON.parse(await readFile(`${folder}/${record}.report.json`, 'utf8'));
return { rows: rowsOf(history), report };
}
const records: string[] = JSON.parse(await readFile('records/m12.json', 'utf8'));
const table = ['| Task | Run | Solved | Minutes | History file |', '|---|---|---|---|---|'];
const left: string[] = [];
for (const run of records.filter((record) => record.includes('-run-'))) {
const checked = await load(run);
const end = checked?.rows.find((row) => row.kind === 'run-end');
if (!checked?.report || !end) {
left.push(`${run}: not checked on ${night}, or not closed`);
continue;
}
if (!checked.report.passed || checked.report.exitCode !== 0) {
left.push(`${run}: did not pass the check on ${night}`);
continue;
}
if (!checked.report.heldFile?.entries.includes(end.entry)) {
left.push(`${run}: the result file is not the one entry ${end.entry} names`);
continue;
}
const review = await load(run.replace('-run-', '-review-'));
if (review && (!review.report?.passed || review.report?.exitCode !== 0)) {
left.push(`${run}: its review record did not pass the check on ${night}`);
continue;
}
const call = review?.rows.filter((row) => row.kind === 'review-counts' || row.kind === 'review-set-aside').at(-1);
const flagged = checked.rows.some((row) => row.kind === 'monitor-flag');
if (call?.kind === 'review-set-aside') {
left.push(`${run}: set aside by ${call.actorId}, review entry ${call.entry}`);
continue;
}
if (flagged && call?.kind !== 'review-counts') {
left.push(`${run}: flagged, and no reviewer has made a call`);
continue;
}
const result = JSON.parse(await readFile(`runs/${run}/result.json`, 'utf8'));
table.push(`| ${result.task} | ${run} | ${result.solved ? 'yes' : 'no'} | ${result.minutes} | \`${checked.report.file.fingerprint}\` |`);
}
await writeFile(`report/m12-results-${night}.md`, [...table, '', 'Left out:', ...left.map((line) => `- ${line}`)].join('\n'));The last call in a review record is the one that stands, so a corrected call replaces the call it amends in the table, and both stay in the record.
What it builds
| Task | Run | Solved | Minutes | History file |
|---|---|---|---|---|
| fix-flaky-test | m12-run-0408 | yes | 96 | 0x3b71...e04c |
| fix-flaky-test | m12-run-0410 | no | 360 | 0x9a02...51d7 |
| port-parser | m12-run-0411 | yes | 214 | 0x5c18...7f20 |
Left out:
- m12-run-0412: set aside by reviewer-3, review entry 2
- m12-run-0415: flagged, and no reviewer has made a call
The list of runs left out is part of the table. It says which runs did not count, and why, in the same file as the runs that did.
The lab checks a row
E-2 sends the lab the table with the night's folder: every record's history file, and E-2's result files with their blinding files. For any row, the lab runs the open-source checker on the history file the row names, with the fingerprint the row gives in HISTORY_FINGERPRINT:
npx @pacspace-io/check m12-run-0408.history.json --fingerprint "$HISTORY_FINGERPRINT"
npx @pacspace-io/check m12-run-0408.history.json --held-file result.json --blinding result.json.pacspace.jsonThe first command says whether the file the lab holds is the one the row names: "The fingerprint you gave names this file." The second says whether the result file is the one the run's last entry names: "The file you hold matches entry 54." Both read the proof layer and never call PacSpace or E-2.
The table is built only from files the lab holds too, so the lab can build it again, with this code or its own, and see the same rows.
What the table shows, and what it does not
The table shows:
- Every row's run passed the check on the night named, and its result file is the one its record names.
- No row is a run a reviewer set aside, and every flagged run in it has a reviewer's call that it counts.
- Every run that did not count, and why.
The table does not show:
- That the result file says what happened in the run. The check shows the record is unchanged since it was committed. It does not show that what was recorded was true.
- That E-2's rules are the right rules. They are in the report, for the lab to question.
- A run the harness never recorded. A gap in the record is as telling as a change, which is why the lab also asks how E-2 keeps its list of runs.