# How OCP fits

> Producers, documents, consumers and the checker, and the layers inside one document.

OCP has three kinds of participant and one artifact between them.

```mermaid
flowchart LR
  subgraph Producers
    O[Orchestrator]
    E[Exporter for a harness]
    C[Converter from a native log]
  end
  D[(run.ocp.json<br/>one per run)]
  subgraph Consumers
    R[Recommender or learner]
    A[Cost analysis]
    V[Dashboards and review]
  end
  O --> D
  E --> D
  C --> D
  D --> R
  D --> A
  D --> V
  D -. checked by .-> K[Checker]
```

- A **producer** writes documents. It is the orchestrator itself, an exporter attached to a harness (through its hooks, logs or telemetry), or a converter that reads a native log after the fact. The `producer` block names it.
- A **document** is one JSON file per run. Documents are self-contained: a reader needs no other file to understand one. The exceptions are [slates](https://orchestrationcontextprotocol.io/specification/0.3/slates), which link runs on one task, and workflows given by reference, which a reader resolves through its catalog.
- A **consumer** reads documents: to recommend a workflow for the next task, to price runs, to compare configurations, or to show what happened.
- A **checker** validates a document against the schema and the [numbered rules](https://orchestrationcontextprotocol.io/specification/0.3/conformance). The reference checker is `loopmath ocp validate`.

## Layers inside a document

Each version added a layer. A producer fills the layers it can.

| Layer | Since | What it holds |
|---|---|---|
| [Run graph](https://orchestrationcontextprotocol.io/specification/0.3/run-graph) | 0.1 | Nodes (units of work), typed edges between them, groups. |
| [Attempts](https://orchestrationcontextprotocol.io/specification/0.3/attempts) and [cost](https://orchestrationcontextprotocol.io/specification/0.3/cost) | 0.1 | Each try at a node: harness, model, effort, cause, status, outcome, tokens and dollars. |
| [Events](https://orchestrationcontextprotocol.io/specification/0.3/events) | 0.1 | An optional log of what happened when. |
| [Artifacts](https://orchestrationcontextprotocol.io/specification/0.3/artifacts), origins, roles, phases | 0.2 | Which attempt wrote what another read; who launched whom; evidence tiers on every inferred edge. |
| [The observation](https://orchestrationcontextprotocol.io/specification/0.3/task) | 0.3 | The task, the configuration that ran with a content-derived id, signals and the acceptance rule, slates and preferences, and a receipt. |

The first four layers describe what happened. The observation layer describes the run as a data point: which task, which configuration, and whether it succeeded under the user's own rule. That is what a learner needs to compare runs across tools.

## Where OCP sits

OCP records a run after the fact. It does not carry calls between models, tools, editors or agents while they run, and it does not start anything. An orchestrator that uses other protocols to run its agents can still write one OCP document per run.

OpenTelemetry's GenAI conventions describe spans as they happen. A span stream can be turned into an OCP document, and OCP adds what spans do not hold: attempts and their causes, the workflow that ran, per-attempt cost with its basis, and outcomes with evidence. See [Implementations](https://orchestrationcontextprotocol.io/docs/implementations#opentelemetry-genai).
