Tools you build on the record
The Shared Record is one tool on the Records API. Yours can be another. Three tools an outside evaluation team builds in house to review the runs it records: a review inbox, a nightly check, and the results table its report rests on.
PacSpace commits the record. You build on it. The Shared Record and the checker are tools we built on the Records API, and yours can be another: your own views of what agents did, your own checks on your own schedule, alerts that read the record. Whatever judges what the record says is yours.
These pages follow one team through three tools it builds in house. Evaluator E-2 tests frontier models for labs before they are released. When a lab gives E-2 access to a model, E-2 runs it as an agent through its own task suite, on its own harness, and writes a record of every run with its own key. E-2's reviewers read the runs, E-2's report says what the model could do, and the lab checks what the report relies on.
The records the tools read
Each run is one record, such as m12-run-0412: model M-12, run 412 of the suite. E-2's harness opens the record when the run starts, writes each tool call as the agent makes it, and closes the record with the transcript and the result. E-2's monitor reads each call as it happens and writes a flag when a call needs a person to look at it, such as a write to the file the task is graded by. The monitor marks the call and lets the run go on.
| Entry | kind · actorId | Title |
|---|---|---|
| 1 | run-start · e2-harness | Run 412: task fix-flaky-test, model M-12, six hour limit |
| 2 to 37 | tool-call · m12-agent | One entry for each tool call, as the harness receives it |
| 38 | monitor-flag · e2-monitor | Entry 37's call wrote to tests/test_retry.py, the file the task is graded by |
| 39 to 61 | tool-call · m12-agent | The rest of the run's tool calls |
| 62 | run-end · e2-harness | Run 412 closed: the task's tests pass, after 2 hours 41 minutes |
Entry 1 carries the fingerprints of the task, its rules, and the model build E-2 was given. Entry 62 carries the fingerprints of the transcript and of result.json, the harness's own file of what the run achieved: the task, whether it was solved, and how many minutes it took. Every file stays in E-2's run store, each with its blinding file beside it. An agent in an evaluation shows a harness writing entries like these.
A run's record closes at its last entry, and a write after that is recorded as an attempt. So a reviewer's call goes in a record of its own, m12-review-0412, which names the run's entries in references:
| Entry | kind · actorId | Title |
|---|---|---|
| 1 | review-opened · e2-review-inbox | Run 412 sent for review: one monitor flag, at entry 38 |
| 2 | review-set-aside · reviewer-3 | Run 412 set aside: the agent changed the test it was graded by |
The three tools
- A review inbox: sends a person every run with a flag and one run in ten without one, after checking the run; shows the reviewer the transcript once it is checked against the record; and records the reviewer's call.
- A nightly check: every night, downloads the history file of every run and every review, runs the open-source checker on it, keeps the file and the checker's report, and tells the team lead about any record that did not pass.
- The results table: builds the table the report rests on from the files the nightly check kept, counts a run only by E-2's own rules, and names the history file behind each row so the lab can check any of them.
| Tool | Reads | Writes | Decides |
|---|---|---|---|
| A review inbox | Each closed run's history, and its transcript | The review records | Which runs a person reads. The reviewer decides whether a run counts. |
| A nightly check | Each record's history file | A report for each record, each night | Whom to tell in the morning |
| The results table | The files the nightly check kept | The table, for the report | Which runs count, by E-2's rules |
Each tool reads the record and decides something. None of them can change it: once committed, no one can change this record, PacSpace included. PacSpace records and never decides. Whether a run should count, and whether a reviewer was right, are E-2's to say and the lab's to question.
The helper the tools share
The three tools read entries from a history they have just checked. This helper turns a history into rows, one for each committed entry, from the sealed record in each receipt. It also holds the fingerprint helper the review inbox writes with.
import { createReadStream } from 'node:fs';
import { fingerprint, readBlindingFile, writeBlindingFile, type RecordHistory } from '@pacspace-io/sdk';
type Receipt = RecordHistory['receipts'][number];
export interface Row {
entry: number;
kind?: string;
title?: string;
occurredAt?: string;
actorId?: string;
}
// The sealed record as committed. A record whose fields are sealed one by one
// carries each field in `revealed`; an older record carries it whole in `recordContent`.
export function fieldsOf(receipt: Receipt): Record<string, unknown> {
if (receipt.revealed) {
return Object.fromEntries(receipt.revealed.map((field) => [field.pointer.slice(1), field.value]));
}
return receipt.recordContent ?? {};
}
// One row for each committed entry. The history keeps the wire's seq, counted from 0;
// a row counts from 1, as every page does.
export function rowsOf(history: RecordHistory): Row[] {
return history.receipts
.map((receipt) => {
const fields = fieldsOf(receipt);
return {
entry: Number(receipt.seq) + 1,
kind: fields.kind as string | undefined,
title: fields.title as string | undefined,
occurredAt: fields.occurredAt as string | undefined,
actorId: fields.actorId as string | undefined,
};
})
.sort((a, b) => a.entry - b.entry);
}
// Fingerprint a file where it is kept, and keep its blinding file beside it.
// A second call for the same file reuses that blinding file, so a retry sends the same fingerprint.
export async function refOf(path: string) {
const kept = await readBlindingFile(`${path}.pacspace.json`).catch(() => undefined);
const { ref, blinding } = await fingerprint(createReadStream(path), { blinding: kept });
if (!kept && blinding) await writeBlindingFile(path, blinding);
return ref;
}Read rows only from a history that passed records.check or the checker. A history that did not pass may not be what was committed.
What the tools need
- E-2's workspace key, in
PACSPACE_API_KEY, on the machines the tools run on. The agent under test never sees it. @pacspace-io/sdkfor every tool, and@pacspace-io/checkfor the nightly check.- A webhook endpoint that takes
record.committed, for the review inbox. See Webhooks.
The code is TypeScript. The Python SDK has the same calls under the same names. The names, numbers, and entries are made up.