> ## 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.

# Ler uma execução

> Uma execução com o veredito de cada cenário e a estatística de cada asserção.



## OpenAPI

````yaml openapi/pt/cell.json GET /v1/scenario-runs/{run_id}
openapi: 3.1.0
info:
  title: API de dados da Niadra
  version: '1'
  description: >-
    Escrita, contexto, histórico, objetos, identidade, privacidade e governança
    de um espaço. Cada espaço tem um endereço estável, com o espaço e a região
    no nome.
servers:
  - url: https://{space}.{region}.api.niadra.com
    variables:
      space:
        default: acme-prod
        description: O espaço, que vem na chave de fonte.
      region:
        default: us-east-2
        description: A região do espaço, que também vem na chave.
security: []
paths:
  /v1/scenario-runs/{run_id}:
    get:
      tags:
        - turns
      summary: Ler uma execução
      description: >-
        Uma execução: o veredito de cada cenário, a estatística de cada asserção
        contra a linha de base e quantas execuções concluíram, tiveram erro de
        infraestrutura ou pararam na conferência dos pinos.


        **Autenticação.** Chave de fonte com o escopo `replay`, ou token de
        pessoa do Console com o papel `integration`, `security` (ou admin). Só
        responde num espaço com a funcionalidade `turns` ligada (o documento
        `features`); num espaço sem ela, 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: A execução.
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
          description: O pedido não bate com o contrato.
      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: O pior dos vereditos dos cenários.
          title: Verdict
      required:
        - run_id
        - status
        - mode
        - build
        - summary
        - created_at
      title: ScenarioRun
      type: object
    Problem:
      additionalProperties: false
      description: >-
        Detalhes do problema no formato da RFC 9457; `code` vem do catálogo de
        erros versionado.
      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: O adaptador de framework e a versão dele, se houver.
          title: Adapter
        pins:
          $ref: '#/components/schemas/TurnPins'
        sdk:
          anyOf:
            - maxLength: 256
              minLength: 1
              type: string
            - type: 'null'
          description: Por exemplo `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: >-
        O que precisa ser igual para um replay reproduzir este turno. O
        documento de gravação diz quais são exigidos; um turno sem um deles é
        guardado, marcado como não reproduzível.
      properties:
        assembler:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: A versão do montador de contexto da própria empresa.
          title: Assembler
        corpus_digest:
          anyOf:
            - pattern: ^sha256:[0-9a-f]{64}$
              type: string
            - type: 'null'
          description: >-
            Digest dos arquivos que o agente consulta, calculado no SDK; nunca
            os arquivos.
          title: Corpus Digest
        model:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: O modelo exato que o agente chamou.
          title: Model
        niadra:
          anyOf:
            - $ref: '#/components/schemas/TurnCompilerPins'
            - type: 'null'
        prompts:
          additionalProperties:
            maxLength: 128
            minLength: 1
            type: string
          description: Nome do prompt -> versão, por exemplo `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: Nome da ferramenta -> hash do esquema dela.
          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: A execução anterior comparada; nenhuma quando foi a gravação.
          title: Baseline Run Id
        completed:
          title: Completed
          type: integer
        infrastructure_errors:
          title: Infrastructure Errors
          type: integer
        needs_paraphrase:
          description: >-
            Uma asserção passou e falhou entre as execuções: a próxima execução
            dela precisa incluir paráfrases.
          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: A versão do compilador de contexto, do contexto lido.
          title: Compiler
        pack_hash:
          anyOf:
            - maxLength: 128
              minLength: 1
              type: string
            - type: 'null'
          description: O hash do contexto que este turno leu.
          title: Pack Hash
      title: TurnCompilerPins
      type: object
    AssertionStats:
      additionalProperties: false
      description: >-
        Uma asserção sobre as execuções concluídas da execução, contra a linha
        de base dela. `p_value` é o teste exato de Fisher unilateral de que a
        execução passa menos vezes que a linha de base, arredondado a 6
        decimais.
      properties:
        baseline_failed:
          title: Baseline Failed
          type: integer
        baseline_passed:
          title: Baseline Passed
          type: integer
        drop:
          description: A taxa de aprovação da linha de base menos a da execução.
          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

````