Skip to content

One job entry shape, published identically by every surface

Three surfaces publish a job, and they publish it with one key set, so a consumer reads a job the same way wherever it finds it.

The rule

Normative: this is the rule
  1. Every surface that publishes a job entry (the single-job read, a run's job list and the jobs inside a run's full document) MUST carry the keys id, label, status, priority, node_id, pipeline_id, created_at, started, completed, execution_time_us, retry_count, max_retries, error_message, input_data, output_data, metadata and timestamp, and nothing else, because the job entry is closed: every surface publishes it alike, and a key one surface adds would make the entry that surface's own.
  2. pipeline_id MUST be a string or null.
  3. A stored value that is neither an integer nor a string MUST be discarded rather than published under a key documented as a string.
  4. The discard is reported, because only something outside the implementation writes a non-scalar there.
  5. execution_time_us MUST prefer the precise duration recorded for the job.
  6. Otherwise execution_time_us MUST be derived from the start and completion stamps at second granularity.
  7. execution_time_us MUST be null for a job that never completed.
  8. The same value MUST be published for a job by node_statuses and by the job entry.
  9. The value is computed once, so the two payloads read side by side can never disagree numerically.

What it means

Three surfaces publish a job, and all three answer through the one key set — not a per-surface copy that happens to agree today. execution_time_us is the clause worth pausing on: it is not always the figure recorded on the job. Where none was recorded it is derived from the start and completion stamps, at second granularity, and that derived figure is computed once and published unchanged wherever a job's execution time appears — so two payloads naming the same job can never disagree on it numerically, even though neither is reading a stored precise duration.

A pipeline_id that is not a string or an integer is not published as whatever it happens to be: it is discarded, because nothing inside the system ever writes a pipeline_id of that shape, so its presence means something outside the implementation wrote it.

Example

A job with no recorded precise duration, started and completed ten seconds apart:

The job's start and completion stampsrecorded
{ "started": 1700000000, "completed": 1700000010 }
The execution_time_us the job entry publishesderived
10000000

A job whose stored pipeline_id is an array rather than a scalar, read in the context of a run the caller named:

The stored pipeline_iddiscarded
["not", "a", "scalar"]
The pipeline_id the job entry publishessubstituted
"caller-pipeline"

Why

Recorded under OPEN-22, OPEN-23, OPEN-25.

Rule identifiers are permanent and are never renumbered. Each implementation publishes its own standing against these rules; this specification does not.spec 1.0 · PIPE-7 · changed in spec 1.0