> ## Documentation Index
> Fetch the complete documentation index at: https://docs.niadra.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Read a run

> One run with the verdict of each scenario and the statistics of each assertion.



## OpenAPI

````yaml openapi/en/cell.json GET /v1/scenario-runs/{run_id}
openapi: 3.1.0
info:
  title: Niadra data API
  version: '1'
  description: >-
    Writing, context, history, objects, identity, privacy and governance of one
    space. Every space has a stable address, with the space and the region in
    its name.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: The space, which comes in the source key.
      region:
        default: us-east-2
        description: The region of the space, which also comes in the key.
security: []
paths:
  /v1/scenario-runs/{run_id}:
    get:
      tags:
        - turns
      summary: Read a run
      description: >-
        One run: the verdict of each scenario, the statistics of each assertion
        against its baseline, and how many executions completed, hit an
        infrastructure error or stopped at the pin check.


        **Authentication.** Source key with the `replay` scope, or a Console
        person token with the `integration`, `security` role (or admin). It
        answers only in a space with the `turns` feature on (the `features`
        document); in a space without it, 404.
      operationId: read_scenario_run_v1_scenario_runs__run_id__get
      parameters:
        - in: path
          name: run_id
          required: true
          schema:
            title: Run Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScenarioRun'
          description: The run.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: The request does not match the contract.
      security:
        - sourceKey: []
        - personToken: []
components:
  schemas:
    ScenarioRun:
      additionalProperties: false
      properties:
        build:
          $ref: '#/components/schemas/TurnBuild'
        created_at:
          format: date-time
          title: Created At
          type: string
        mode:
          enum:
            - hermetic_turn
            - hermetic_conversation
            - era_memory
          title: Mode
          type: string
        run_id:
          maxLength: 512
          minLength: 1
          title: Run Id
          type: string
        status:
          enum:
            - pending
            - done
          title: Status
          type: string
        summary:
          $ref: '#/components/schemas/ScenarioRunSummary'
        vary:
          items:
            enum:
              - prompts
              - corpus_digest
              - model
              - assembler
              - tool_schemas
            type: string
          title: Vary
          type: array
        verdict:
          anyOf:
            - enum:
                - pass
                - flaky
                - infrastructure_error
                - pin_mismatch
                - regression
              type: string
            - type: 'null'
          description: The worst of the scenarios' verdicts.
          title: Verdict
      required:
        - run_id
        - status
        - mode
        - build
        - summary
        - created_at
      title: ScenarioRun
      type: object
    Problem:
      additionalProperties: false
      description: RFC 9457 problem details; `code` comes from the versioned error catalog.
      properties:
        code:
          title: Code
          type: string
        detail:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Detail
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          default: null
          title: Request Id
        status:
          title: Status
          type: integer
        title:
          title: Title
          type: string
        type:
          default: about:blank
          title: Type
          type: string
      required:
        - title
        - status
        - code
      title: Problem
      type: object
    TurnBuild:
      additionalProperties: false
      properties:
        adapter:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: The framework adapter and its version, if any.
          title: Adapter
        pins:
          $ref: '#/components/schemas/TurnPins'
        sdk:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: E.g. `niadra-python/0.7.0`.
          title: Sdk
      title: TurnBuild
      type: object
    ScenarioRunSummary:
      additionalProperties: false
      properties:
        scenarios:
          items:
            $ref: '#/components/schemas/ScenarioVerdict'
          title: Scenarios
          type: array
      title: ScenarioRunSummary
      type: object
    TurnPins:
      additionalProperties: false
      description: >-
        What must be the same for a replay to reproduce this turn. The recording
        document says which are

        required; a turn without one of them is kept, marked not replayable.
      properties:
        assembler:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: The version of the company's context assembler.
          title: Assembler
        corpus_digest:
          anyOf:
            - pattern: ^sha256:[0-9a-f]{64}$
              type: string
            - type: 'null'
          description: >-
            Digest of the files the agent consults, computed in the SDK; never
            the files.
          title: Corpus Digest
        model:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: The exact model the agent called.
          title: Model
        niadra:
          anyOf:
            - $ref: '#/components/schemas/TurnCompilerPins'
            - type: 'null'
        prompts:
          additionalProperties:
            maxLength: 128
            minLength: 1
            type: string
          description: Prompt name -> version, e.g. `core` -> `v16`.
          maxProperties: 50
          propertyNames:
            maxLength: 256
            minLength: 1
          title: Prompts
          type: object
        tool_schemas:
          additionalProperties:
            pattern: ^sha256:[0-9a-f]{64}$
            type: string
          description: Tool name -> hash of its schema.
          maxProperties: 200
          propertyNames:
            maxLength: 256
            minLength: 1
          title: Tool Schemas
          type: object
      title: TurnPins
      type: object
    ScenarioVerdict:
      additionalProperties: false
      properties:
        assertions:
          items:
            $ref: '#/components/schemas/AssertionStats'
          title: Assertions
          type: array
        baseline_run_id:
          anyOf:
            - maxLength: 512
              minLength: 1
              type: string
            - type: 'null'
          description: The earlier run compared against; none when it was the recording.
          title: Baseline Run Id
        completed:
          title: Completed
          type: integer
        infrastructure_errors:
          title: Infrastructure Errors
          type: integer
        needs_paraphrase:
          description: >-
            An assertion passed and failed across the runs: its next run must
            include paraphrases.
          title: Needs Paraphrase
          type: boolean
        pin_mismatches:
          title: Pin Mismatches
          type: integer
        scenario_id:
          maxLength: 512
          minLength: 1
          title: Scenario Id
          type: string
        verdict:
          enum:
            - pass
            - flaky
            - infrastructure_error
            - pin_mismatch
            - regression
          title: Verdict
          type: string
      required:
        - scenario_id
        - verdict
        - completed
        - infrastructure_errors
        - pin_mismatches
        - needs_paraphrase
        - assertions
      title: ScenarioVerdict
      type: object
    TurnCompilerPins:
      additionalProperties: false
      properties:
        compiler:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: The context compiler's version, from the pack.
          title: Compiler
        pack_hash:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: The hash of the pack this turn read.
          title: Pack Hash
      title: TurnCompilerPins
      type: object
    AssertionStats:
      additionalProperties: false
      description: >-
        One assertion over the run's completed executions, against its baseline.
        `p_value` is the one-sided

        Fisher exact test that the run passes less often than the baseline,
        rounded to 6 decimals.
      properties:
        baseline_failed:
          title: Baseline Failed
          type: integer
        baseline_passed:
          title: Baseline Passed
          type: integer
        drop:
          description: The baseline's pass rate minus the run's.
          title: Drop
          type: number
        failed:
          title: Failed
          type: integer
        flaky:
          title: Flaky
          type: boolean
        id:
          pattern: ^[a-z0-9][a-z0-9_.-]{0,63}$
          title: Id
          type: string
        not_checked:
          title: Not Checked
          type: integer
        p_value:
          title: P Value
          type: number
        passed:
          title: Passed
          type: integer
        regression:
          title: Regression
          type: boolean
      required:
        - id
        - passed
        - failed
        - not_checked
        - baseline_passed
        - baseline_failed
        - drop
        - p_value
        - regression
        - flaky
      title: AssertionStats
      type: object
  securitySchemes:
    sourceKey:
      type: http
      scheme: bearer
      description: nia_sk_...
    personToken:
      type: http
      scheme: bearer
      bearerFormat: JWT

````