SOBEK/ STREAM
Sobek Stream API

Submit work.
Keep the record.

Submit a versioned task against an opaque local workspace. Stream applies typed operations, runs the declared checks, and returns a result that can be replayed.

202 Acceptedtasks run asynchronously
Local onlysource stays in the workspace
GPU onlymodel inference fails closed on CPU

Routes

Discovery is the contract surface. The API is task-oriented; source and raw model output are not public resources.

GET/healthzservice health
GET/v1/stream/discoveryversioned index
GET/v1/stream/workflowsworkflow registry
GET/v1/stream/workflows/{workflow_id}workflow package
GET/v1/stream/skillsSkill registry
GET/v1/stream/gatesacceptance Gates
GET/v1/stream/modelsmodel catalog
GET/v1/stream/nodesnode registry
POST/v1/stream/taskssubmit work
GET/v1/stream/tasks/{task_id}task summary
POST/v1/stream/tasks/{task_id}/cancelcancel work
GET/v1/stream/tasks/{task_id}/eventsevent stream
GET/v1/stream/tasks/{task_id}/evidenceretained evidence
GET/v1/stream/tasks/{task_id}/provenanceretained provenance
GET/v1/stream/dashboardoperational summary
GET/v1/stream/policypolicy contract
POST/v1/stream/ledger/ingestnode ingest
GET/metricsPrometheus surface

Task contract

The request chooses the workflow and states the boundaries. workspace.path_ref is resolved only by an approved local Workerd; it is represented as opaque metadata after execution.

POST /v1/stream/tasks
{
  "task_version": "1.0",
  "task_id": "missing-import",
  "workflow": "stream.workflow.repo.bugfix.v1",
  "workspace": {
    "workerd": "local",
    "path_ref": "/approved/example-repo"
  },
  "goal": "Repair the missing include",
  "acceptance": {
    "tests": ["compile"],
    "write_scope": ["main.c"]
  },
  "policy": {
    "retention": "metadata_only"
  }
}
Response / 202
{
  "id": "missing-import",
  "status": "queued",
  "events_url": "/v1/stream/tasks/.../events",
  "evidence_url": "/v1/stream/tasks/.../evidence",
  "provenance_url": "/v1/stream/tasks/.../provenance"
}
A full task contract, including budgets and retention, is required. Duplicate task IDs are rejected instead of being run twice.

Lifecycle

Submission is durable before execution begins. Queue admission is finite and FIFO within a service instance; a full queue returns 429.

01created → queuedpersist request
02queued → runningreserve execution slot
03running → completedGates and Judge agree
04running → failed / cancelledfail closed
Cancellation is cooperative for running work. Retention none keeps only a source-free terminal boundary and exposes no event sequence or evidence bundle.

Evidence and provenance

Accepted work leaves an objective record: workflow resolution, capsule and snapshot digests, Gates, Breakers, Judge decision, resource meters, and replay metadata. Retained reports contain metadata rather than source, task goals, event payloads, or patch text.

Acceptance

Compile, test, write-scope, benchmark, and workflow-specific Gates run inside the bounded transaction. A rejected or ambiguous proposal does not mutate the canonical workspace.

Resources

Usage and metrics expose wall, accelerator, CPU, and model timing. Model inference requires an explicit GPU hardware profile and runtime identity; CPU remains available for compilation and verification.

For the full schemas and workflow operation vocabulary, see the repository references for the protocol, workflows, and threat model.