Skip to content

Correcting an entry

A worked example: a release record's test entry stated the wrong count. A new entry corrects it and names the entry it corrects, so the original and the correction both stay visible.

A lab's release record says build 2026.10.1 passed 412 of 412 tests. The test report that entry carries says 411 passed and 1 was skipped. Nothing in a record is edited, so the fix is a new entry that names the one it corrects and says why. Afterward the record shows both: the entry as it was written, and the correction beside it.

An amendment is a new entry. This one stays as it was written.

The record before

EntryTitleactorIdlifecycle
1Release 2026.10: build 2026.10.1 created, 30 Septemberrelease-pipelinerecorded
2Build 2026.10.1 passed 412 of 412 testssafety-evalsrecorded

The correction

amends names the corrected entry by the record's key, recordKey in every write's answer and in the history, and by its number. Set lifecycle to amended and put the reason in note. The correction carries the same test report's fingerprint as entry 2, made again from the report and its blinding file, so a reader can see it is about the same report.

TypeScript
import { createReadStream } from 'node:fs';
import { fingerprint, readBlindingFile } from '@pacspace-io/sdk';

// The same report and its blinding file give the same fingerprint entry 2 carries.
const blinding = await readBlindingFile('test-report-2026.10.1.json.pacspace.json');
const { ref: report } = await fingerprint(createReadStream('test-report-2026.10.1.json'), { blinding });

const corrected = await pac.records.emit({
  record: 'release-2026.10',
  lifecycle: 'amended',
  title: 'Build 2026.10.1 test count restated: 411 of 412 passed, 1 skipped',
  kind: 'test-completed',
  occurredAt: '2026-10-02T17:40:00Z',
  actorId: 'safety-evals',
  payloads: [report],
  // entries count from 1
  amends: { recordKey: releaseKey, entry: 2 },
  note: 'Entry 2 counted a skipped test as passed. The report it carries is unchanged.',
  idempotencyKey: 'release-2026.10:tested:correction',
});

releaseKey (release_key in Python, RELEASE_KEY in the shell) is the recordKey from the answer to the record's first write. In the shell, REPORT_DIGEST and REPORT_BYTE_LENGTH are the digest and byteLength of the report's fingerprint, made again from the report and its blinding file. On the wire amends.seq is the entry's position counted from 0, so entry 2 is seq: 1; the SDKs take entry: 2 and convert. occurredAt stays the time the tests finished, because that is when the thing being restated happened; the correction's own time is when it is committed.

The record after

EntryTitleactorIdlifecycle
1Release 2026.10: build 2026.10.1 created, 30 Septemberrelease-pipelinerecorded
2Build 2026.10.1 passed 412 of 412 testssafety-evalsrecorded, amended by entry 3
3Build 2026.10.1 test count restated: 411 of 412 passed, 1 skippedsafety-evalsamended, amends entry 2

Entry 2 is unchanged: its seal still matches and its receipt still checks. On the record page and the Shared Record both entries are shown, each marked, with the note beside the correction. A reader whose link reveals the two entries' fields sees the pair and reads why. The record is still named by entry 1's title.

When the correction is refused

A correction names an entry that is already committed and comes before it. Nothing is queued in any of these refusals.

CodeThe ruleWhat to do
RECORD_AMENDS_NOT_FOUND (422)A correction names a committed entry of this record, or an entry of a closed record that it also names in references.Check recordKey and the entry number. For another record's entry, add it to references.
RECORD_AMENDS_NOT_PRECEDING (422)The entry named is not yet committed.Wait for it to commit, or name the entry you meant.
RECORD_AMENDS_NOT_ADMITTED (422)Amendments are not yet admitted for writes in this environment.Send the correction once they are; ask us when that will be for your workspace.

A correction is a write like any other: one idempotency key, QUEUED in the answer, then record.committed at your webhook or status: committed in the history.

What a correction does

It adds an entry. It removes, replaces, and hides nothing: the original stays as it was written, and the record shows that it was corrected, by what, and why. If the entry you would correct is the record's first, its title is still the record's name. If what you need is to end the record, send lifecycle: closed instead; see Records and entries. A closed record can still be corrected from a new record, whose entry names the corrected one in both amends and references; the closed record stays closed and the correction lives beside it.