run_trial
Execute a controlled experiment trial by invoking the executor with the bundle's training config; long jobs return running so you can poll status.
Instructions
Run a trial by calling the executor role.
Imports run_training from the bundle's code_ref and calls it with the trial config. The code_ref must be a path to a .py file exposing def run_training(config: dict) -> dict returning {"metrics": {...}, "variance": {...}}. Read the executor://contract resource for the full contract.
When the bundle carries data_refs, the config handed to run_training is extended with two injected keys: 'data_paths' ({split: resolved read-only path}) and 'data_ref_paths' ({data_ref_id: resolved read-only path}). The stored config_json keeps the designed config verbatim — the injection is runtime-only.
For long-running jobs, this returns quickly with status "running". Use get_trial_status to poll for completion. Note the return is not immediate — there is a consistent ~10 s handshake/settle before status "running" comes back; that settle window is what makes cancel-race behaviour reproducible.
Enforcement: commitment 6 — the bundle must be controlled. Rejects if the bundle is not fully captured. Concurrency: rejects if trial is already running (no double execution).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| trial_id | Yes | ID of the target trial. | |
| programme_id | Yes | ID of the programme owning the trial — required; the programme_id returned by design_experiment/list_trials (orphan check). The programme must be status=active — completed/abandoned/archived programmes are closed, immutable records. | |
| timeout_seconds | No | Per-trial hard deadline override in seconds — the executor kills the process past it. None uses the server default ([executor] timeout_seconds). Bounded by [executor] max_timeout_seconds; the applied value is recorded in executor_output.timeout_seconds. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | ||
| status | No | ||
| message | No | ||
| trial_id | No | ||
| executor_output | No |