---
title: "Test and explain a draft"
description: "Inspect coverage, compare a draft and debug its runs before release."
canonical_url: "https://docs.oz0.ai/build/plugins/studio/test-and-explain"
---
# Test and explain a draft

> Inspect coverage, compare a draft and debug its runs before release.

For: plugin authors.

Inspect coverage, compare a draft and debug its runs before release.

## Compare a draft with the installed version

Before you save or install a draft of an installed plugin, Test / Compare draft (also under More) runs one of its agents as installed and as your draft on the plugin's eval cases, side by side as shadow runs, and says whether the draft is better, the same or worse ([comparisons of a changed agent](https://docs.oz0.ai/improve/comparisons-of-a-changed-agent)). The draft runs as a private candidate on the nodes you name, only while the comparison lives; the test bench keeps running the installed version. From the CLI: `oz0 compare start <agent> --variant draft=<folder> --nodes pool=dev --budget 1`.

## Policy coverage

In the inspector's Checks tab, Policy coverage shows the [policy-path coverage](https://docs.oz0.ai/improve/evals/coverage#policy-path-coverage) the folder's `evals/coverage.json` holds, as `oz0 plugin test --coverage` last wrote it: the share of the plugin's decision-point branches its eval cases reached, the threshold the run had, the counts per kind, and the branches no case reached. Each missed branch opens the file that declares it, such as the agent whose loop rule no case triggered. Save `evals/coverage.json` with the plugin to see it here; the studio reads it as the folder's other files, never runs anything for it.

## Explain

The Explain inspector tab makes the files of [`oz0 plugin explain`](https://docs.oz0.ai/build/parts/flows/flow-tools#explain-a-plugin-for-an-auditor) for the head, the revision you are looking at or your draft: the drawing as SVG, its Mermaid source, one printable page and the same facts as JSON. Name a flow to keep only that flow, or leave it empty for the whole plugin. The panel shows the drawing and a Download button for each file; open `summary.html` in a browser and print it to PDF. Sections your role does not read, such as the tool policy without `governance.read`, are left out, and the panel says which.

## The test bench

Test bench (`/studio/bench`) runs an agent or a flow and shows its result, its cost and its trace on the same page. Pick one on the left, then give its input:

- Form, when the agent's input schema is flat: strings, numbers, booleans, choices and lists of those. The form only turns what you type into values; the edge checks the input against the schema when the job starts, and says what does not fit.
- JSON, for any schema, or Text for agents that take text.

Then choose its answers:

<table>
<thead>
  <tr>
    <th>
      Answers
    </th>
    
    <th>
      What happens
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Live
    </td>
    
    <td>
      The job calls the models, and pays for them, as any job does
    </td>
  </tr>
  
  <tr>
    <td>
      Recorded model answers
    </td>
    
    <td>
      Pick a cassette from the plugin's <code>
        evals/cassettes/
      </code>
      
      , the ones <a href="https://docs.oz0.ai/improve/evals/recordings#record-once-replay-after">
        <code>
          plugin test --record
        </code>
      </a>
      
       writes, or paste one. The edge answers the job's model calls, and those of its child jobs, from it in order, and charges nothing for them. A call that differs from the recording is answered anyway and named under the result; a call past the recording's end fails
    </td>
  </tr>
  
  <tr>
    <td>
      Recorded step outputs
    </td>
    
    <td>
      For a flow: pick a recording from <code>
        evals/steps/
      </code>
      
      . The flow's conditions and expressions run on the recorded outputs, and no tool, agent or person is called
    </td>
  </tr>
  
  <tr>
    <td>
      Live, and record the steps
    </td>
    
    <td>
      For a flow: it runs live, and records its steps' outputs, which Keep as an eval case keeps
    </td>
  </tr>
</tbody>
</table>

Under a finished run, Keep as an eval case uses the same procedure as the job page's button ([keep a job as an eval case](https://docs.oz0.ai/improve/evals/regressions#keep-a-job-as-an-eval-case)):

1. It shows what the case holds and asks you to confirm that it becomes plugin source, readable by every workspace reader.
2. For an agent, it runs the case three times against the live model and labels it regression, flaky or not reproduced.
3. It writes the case's input, status and error into the agent's or flow's evals in your draft. It also writes the cassette, or a flow's recorded steps, redacted and shown before you keep them.

A cassette whose answers hold a value you redacted or a secret is left out, and the message says so. Keeping needs the operator role with the content permission; writing into the draft needs the admin role, and without it the case is downloaded instead. A case from a data subject's job is kept only by an admin, only into the workspace.

Recorded answers decide what the model says, tool calls included, so starting a job with them needs the admin role, as `plugin test` does. Such jobs are marked as replays: rollout gates, shadow runs and the dashboards leave them out, and each start is in the [audit trail](https://docs.oz0.ai/govern/audit-trail) as `run.replay`.

A run with recorded model answers gets a new job ID of its own, and runs for at most seven days, as long as the edge keeps its recording; until then no other job can be started under that ID, so the recording answers that run and nothing else. If the edge cannot read the next recorded answer, or whether a job has a recording at all, that call fails and the node retries it. It never goes to a provider.

Such a run's job ID starts with `replay-`, which no caller can choose, and its calls are answered only from its recording: one whose recording is no longer kept is refused.

The bench runs what the tenant has installed. When the workspace has a newer revision than the installed one, the bench says so; install it to test it, through its checks and gate.

## The debugger

Open any job in the debugger with Debug under More on its page, or Open in the debugger in the bench (`/studio/debug/<job>`). It lists the job's steps in the order they began: waits for a node, model calls, tool calls, hooks, approvals and questions, harness sessions and child jobs. Step through them with `j` and `k` (or the arrow keys), and press `Enter` to see a step's input and output. Show content as I step loads each one as you go.

- A child job's step opens that job in the debugger; the bar above lists its parents.
- Open on the right goes to the agent's file in the studio, at the revision that ran when the job records it. Otherwise it opens the installed revision, and the debugger says it does not know which revision ran. For a plugin from Git, it goes to the plugin's repository.
- Re-run from here starts a new run in the test bench with the input the step started an agent with: the job's own input, or a child job's. The bench gets that input once, for that agent only. It is not put in the URL, and a reload or another agent picked in the bench starts empty. The job's history is never changed.
- `Enter` on a focused button or link does what that control does, for example selecting the step or opening the child job. On the page itself, `Enter` shows the current step's content.
- For a long agent that continued as new, The job's input and answer shows the input of its first run and the answer of its last one.

A step's input and output can hold your customers' data: seeing them needs the content permission, and each look is in the audit log. Without it, the debugger shows the shape of the job: its steps, their timing, tokens and cost.


## Sitemap

See the full [sitemap](https://docs.oz0.ai/sitemap.md) for all pages.
