Skip to main content
Recording runs from your own harness gives an existing benchmark runner, simulator, or job in another language the same datasets, summaries, CI gate, and comparisons as Eval; the same recording works for the atlanai SDK’s Eval, pytest, Vitest, the Node.js test runner, and custom harnesses. Use it when you already have a harness and do not want to rewrite it around Eval. Eval performs these same steps internally, so prefer it for new evals: see Run your first eval.

Before you begin

Before you start, make sure you have:
  • atlanai SDK with tracing: Installed as in Run your first eval, or an OTLP exporter for another language.
  • Dataset: A record-backed or CSV-backed dataset in the workspace. See Create eval datasets.
  • API key and workspace ID: A key that can create scorers, experiments, and results in the workspace.
1

Create scorer and start experiment

Every score needs a scorer ID and version, or its score span is dropped. Create a code scorer once and reuse it. It stores no definition, so give it a new name when its logic changes.start_experiment (startExperiment, or POST /eval/v1/experiments) starts the experiment in running and pins the dataset snapshot. Experiment names are unique per workspace.
my_runner.py
2

Trace and score each case

Run each case inside run.trace() in Python, or propagateAttributes(run.traceOptions, fn) in TypeScript. Every span is then stamped with the experiment ID, so it appears in the experiment’s trace views. Use one root span per case.
  • trace_id: The 32-character lowercase hex ID of that case’s trace. Read it from the root span, as above. Do not invent one.
  • dataset_record_id: Required on every result of a record-backed experiment, and it must be a record in the pinned snapshot. Omit it for inline cases.
  • case_id: Unique within the experiment. A second result with the same case_id is refused with 409 duplicate_case_id, which makes an upload retry safe.
3

Upload results and finalize

Traces export in the background, so flush them before you finalize. Upload at most 100 results per call: each item is accepted or refused on its own, so check every status. Each item’s workspace_id must match the experiment’s workspace, so a result reported for a different workspace is refused. Results are create-only.
Completing the experiment computes summary.scores and the counts result_count, scored_results, and unscored_results from the results and freezes its status and summary. A result is scored when any of its scores is a finite number, zero included; empty runs report three zero counts. Set experiment_status to failed for a run you abandon.
4

Verify experiment evidence

To check the setup, complete a small experiment, then inspect its result and confirm each case links to its trace. Traces become queryable a few seconds after flush(). Then confirm the evidence is complete:
The run is recorded when the check passes and done.summary["scores"] has an entry for each score. If a result is refused, see Eval errors.
5

Run CSV-backed dataset (optional)

A dataset created from a CSV file pins the file rather than records. Read the pinned version’s rows, run them, and name each result by its case_id column. Do not set dataset_record_id.
Every case_id must exist in the pinned CSV. The CI action and comparisons pair CSV-backed runs on case_id.
6

Record from another language (optional)

The same steps are plain HTTP. Send Authorization: Bearer <token> and X-Atlan-Workspace-Id on every call, and include workspace_id in each create body.
scores values must be numbers or null. A result for a completed or failed experiment is refused with 409. To make scores visible in trace statistics too, emit one score span per score: a child span with atlan.span.type = "score" and the attributes atlan.score.name, atlan.score.value, atlan.score.scorer_id, and atlan.score.scorer_version.

Troubleshooting

Upload failures include a trace_id that is not 32 lowercase hex characters, a dataset_record_id outside the pinned snapshot, and a result sent after the experiment finished. See Eval errors.

Next steps

See also