run_records

A run's membership

What you'll learn

You're writing SQL that reads run_records and need its columns, what each holds, and the DDL as the spec states it.

  • every column and its type
  • what the object holds and who writes it
  • the DDL as the spec states it

A table. A run's membership: state = last completed step id, verdicts = {step_id: pass|fail}.

Columns

ColumnTypeConstraints
run_idTEXTNOT NULL REFERENCES runs(id)
identity_idTEXTNOT NULL REFERENCES identities(id)
stateTEXTNOT NULL
verdictsTEXTNOT NULL DEFAULT '{}'

Table constraints: PRIMARY KEY (run_id, identity_id).

Definition

From spec/ledger.sql, which is the machine-checkable form of SPEC.md §3:

CREATE TABLE run_records (
  run_id      TEXT NOT NULL REFERENCES runs(id),
  identity_id TEXT NOT NULL REFERENCES identities(id),
  state       TEXT NOT NULL,              -- last completed step id, or 'sourced'
  verdicts    TEXT NOT NULL DEFAULT '{}', -- JSON: {step_id: pass|fail}
  PRIMARY KEY (run_id, identity_id)
);

Used in

  • Recover: The table that holds each record's last completed step, which is what resume reads