RunJobStreamEvent run.job-stream-event@1

Generated at from openvibe-contracts v0.97.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
run
Visibility
public
Status
planned
Compatibility
backward
Decision
ADR-034
Schema
https://openvibe.network/contracts/run/job-stream-event.v1.json

run.job-stream-event@1 (PLANNED; plan T14 R1): the JSON `data` of one server-sent event on GET /api/v1/jobs/{id}/stream (capability run.job.stream). The SSE `event` field is the type and the SSE `id` is `seq`, so a reconnect with Last-Event-ID resumes after it. output: a chunk of the job's stdout (platform.job-frame@1 job_stdout, best effort: a chunk lost on the node's link is never resent, and Run keeps at most the last 1 MiB to replay). state: the job moved to a new state. end: the job reached its end state; the server closes the stream after it. A stream opened on an ended job replays what is kept, then end. Output is never metered and never in an event.

Fields

FieldTypeRequiredDescriptionConstraints
typeenumyes
  • one of "output", "state", "end"
job_idstringyes
  • pattern ^job_[0-9A-HJKMNP-TV-Z]{26}$
seqintegeryesThe job's own stream counter from 1; the SSE id.
  • minimum 1
atstringyes
  • format date-time
chunkstringoutput only: UTF-8 text.
  • maxLength 65536
stateenumstate and end: the job's state.
  • one of "queued", "placed", "running", "succeeded", "failed", "cancelled", "expired"

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: end
{
  "type": "end",
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 4,
  "at": "2026-10-04T10:00:03.000Z",
  "state": "succeeded"
}
Valid: output
{
  "type": "output",
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 3,
  "at": "2026-10-04T10:00:01.000Z",
  "chunk": "resized 1 of 1\n"
}
Valid: state
{
  "type": "state",
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 2,
  "at": "2026-10-04T10:00:00.650Z",
  "state": "running"
}
Rejected: end-while-running
{
  "type": "end",
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 4,
  "at": "2026-10-04T10:00:03.000Z",
  "state": "running"
}
Rejected: output-without-chunk
{
  "type": "output",
  "job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "seq": 3,
  "at": "2026-10-04T10:00:01.000Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('run.job-stream-event@1', value);   // { valid, errors: [{ path, message }] }