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

# Get a trail by number (repo_id addressing)

> <Badge color="blue" size="sm" shape="pill">Users</Badge> <Badge color="blue" size="sm" shape="pill">Plugins</Badge>

**Accepted credentials:** User token, Plugin installation token.

A single trail by number, addressed by opaque repo id. Same fields and composition boundary as the wire-parity path.

Use an own-account bearer token (including supported service accounts) or a Core-issued plugin installation bearer token, subject to the permissions and restrictions below. Plugin assertion JWTs and plugin OAuth user-delegation tokens are not accepted here.

Requires live repository pull permission (contents:read for plugin installations). Other authorized automation principals can also use this operation. Trails must be enabled. Send requests to the repository’s primary API region.



## OpenAPI

````yaml /openapi/generated/trails.json get /repos/{repo_id}/trails/{number}
openapi: 3.1.0
info:
  description: >-
    Unified Entire API gateway. Aggregates the control plane and regional
    repository-operation services behind a single endpoint.
  title: Entire API
  version: 0.1.0
servers:
  - url: https://aws-us-east-2.api.entire.io/api/v1
security:
  - bearerAuth: []
tags:
  - description: Operations under the /search surface.
    name: search
  - description: Operations under the /semantic-search surface.
    name: semantic-search
  - description: Operations served by the brainstore service.
    name: brainstore
  - description: >-
      The authenticated caller's own cross-repo activity, commits, checkpoints,
      sessions, and recap.
    name: me
    x-group: Your activity
  - description: >-
      Residency-aware previews of the caller's surface, served under
      /experimental. Shapes may change without notice.
    name: experimental
  - description: >-
      Per-user settings: pinned and recent repos, diff view, and saved filter
      tabs.
    name: preferences
  - description: >-
      Repository discovery list, metadata, and headline rollups (summary,
      activity, contributors, agents).
    name: repos
  - description: >-
      Git browsing for a repo: commits, commit detail, branch compare, tree
      listings, raw file bytes, and branches.
    name: code
  - description: >-
      Checkpoint listing, resolution, LLM analysis, transcripts, and per-repo
      checkpoint status.
    name: checkpoints
    x-group: Checkpoints
  - description: >-
      Materialised sessions: listing, detail, transcripts, rename, and the
      public-share toggle.
    name: sessions
    x-group: Sessions
  - description: >-
      Repo dashboard aggregates under /overview: commit and checkpoint stats,
      contributor breakdowns, and session patterns.
    name: overview
  - description: Live ref-change stream for a repo (SSE).
    name: refs
    x-group: Ref events
  - description: >-
      Trails themselves: list, create, read, update, delete, plus per-repo
      counts, claimed branches, and the body-document ensure.
    name: trails
    x-group: Trails
  - description: >-
      What has happened on a trail: the merged timeline, the event stream, and
      who is watching (per trail, plus a repo-wide roll-up).
    name: trail-activity
    x-group: Activity
  - description: >-
      Conversation on a trail: discussions, their messages, and the live
      discussion-event stream.
    name: trail-discussions
    x-group: Discussions
  - description: >-
      Code review on a trail: review state, comments, diffs, reviewed files, and
      review re-runs.
    name: trail-reviews
    x-group: Reviews
  - description: >-
      Runner output on a trail: the latest result per configured runner, monitor
      results, and manual launches.
    name: trail-runs
  - description: >-
      Quality gates: repo gate definitions, gate settings, repo-authored monitor
      definitions, and a trail's gate evaluation.
    name: trail-gates
    x-group: Gates
  - description: >-
      Getting a trail landed: approval decisions, merge readiness, and the merge
      itself.
    name: trail-approvals
    x-group: Approvals
  - description: >-
      Trail attachment blobs: upload intent, completion, retrieval, and
      deletion.
    name: trail-attachments
  - description: Project-scoped Trails, and their owned repository Changes and discussions.
    name: projects
  - description: Agent-provenance ranking for a repo's code scopes.
    name: experts
    x-group: Experts
  - description: >-
      git-meta-compatible repo metadata read and write (git is the source of
      truth).
    name: git-meta
  - description: >-
      A project's versioned agents — what each runs (its own runner or an Entire
      preset), what it is called, the environment it runs in, the repositories
      it reviews and its trigger — and Entire's presets. Saving one runs
      nothing.
    name: agents
  - description: >-
      A project's saved, versioned Environments — where an agent runs: provider
      and sandbox lifetime — reusable across the project's repositories and
      agents. Configuration only: saving one provisions nothing.
    name: environments
  - description: >-
      Runs of a project's agents, each on one Change: starting one, the
      immutable snapshot each captured, status, output and results, retry and
      cancel.
    name: runs
  - description: >-
      Mutating repo configuration: runner, trail, public-sharing, and
      gate-enforcement settings (requires repo manage_settings for every forge).
    name: repo-settings
  - description: The caller's open pull requests across their repositories.
    name: pull-requests
  - description: 'Service-authed only: editor-document sync behind the trail body editor.'
    name: trails-internal
  - description: The runner OIDC issuer's discovery document and JWKS. Machine-consumed.
    name: runner-issuer
  - name: repositories
    x-group: Git
paths:
  /repos/{repo_id}/trails/{number}:
    get:
      tags:
        - trails
      summary: Get a trail by number (repo_id addressing)
      description: >-
        <Badge color="blue" size="sm" shape="pill">Users</Badge> <Badge
        color="blue" size="sm" shape="pill">Plugins</Badge>


        **Accepted credentials:** User token, Plugin installation token.


        A single trail by number, addressed by opaque repo id. Same fields and
        composition boundary as the wire-parity path.


        Use an own-account bearer token (including supported service accounts)
        or a Core-issued plugin installation bearer token, subject to the
        permissions and restrictions below. Plugin assertion JWTs and plugin
        OAuth user-delegation tokens are not accepted here.


        Requires live repository pull permission (contents:read for plugin
        installations). Other authorized automation principals can also use this
        operation. Trails must be enabled. Send requests to the repository’s
        primary API region.
      operationId: trailDetailByRepoID
      parameters:
        - description: >-
            readings keeps the legacy reading-only history; runs includes
            preserved cancellations and a kind discriminator on every entry.
          explode: false
          in: query
          name: agent_history
          schema:
            default: readings
            description: >-
              readings keeps the legacy reading-only history; runs includes
              preserved cancellations and a kind discriminator on every entry.
            enum:
              - readings
              - runs
            type: string
        - description: 'Repo id: placement ULID or public repo_<group ULID>'
          in: path
          name: repo_id
          required: true
          schema:
            description: 'Repo id: placement ULID or public repo_<group ULID>'
            type: string
        - description: Trail number
          in: path
          name: number
          required: true
          schema:
            description: Trail number
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrailDetailResponse'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Service Unavailable
      deprecated: true
      security:
        - oauth2: []
        - oidc: []
        - bearerAuth: []
components:
  schemas:
    TrailDetailResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/TrailDetailResponse.json
          format: uri
          readOnly: true
          type: string
        actions:
          allOf:
            - description: >-
                Availability by operation for this caller and Trail snapshot.
                The server revalidates every submitted command.
            - $ref: '#/components/schemas/TrailActions'
        agents:
          description: >-
            Saved agents with a run on this Change, apart from the repository
            runners' monitors: each one's latest run, its signal's readings and
            who it is.
          items:
            $ref: '#/components/schemas/TrailAgentJSON'
          type:
            - array
            - 'null'
        author:
          $ref: '#/components/schemas/TrailAuthor'
        base:
          type: string
        base_missing:
          description: >-
            True when the base branch doesn't exist in the repository, so the
            Change can't be compared, gated or reviewed until someone pushes the
            base or changes the Change's base. False on a merged or closed
            Change.
          type: boolean
        base_sha:
          type:
            - string
            - 'null'
        body_document:
          $ref: '#/components/schemas/TrailBodyDocumentJSON'
        branch:
          type:
            - string
            - 'null'
        branch_state:
          description: >-
            Observed availability of the associated branch. Unknown is not a
            deletion; original_branch is a historical name, not proof of a live
            branch.
          enum:
            - present
            - deleted
            - unlinked
            - unknown
          type: string
        code_changes:
          description: >-
            Current code evidence: present means commits ahead of base, none
            means a confirmed zero or an indexed base tip equal to the displayed
            head when comparison is unavailable, unknown means no usable
            evidence for a Change that tracks a branch. not_applicable means no
            live comparison exists (merged, closed or unlinked); terminal
            history uses frozen snapshot refs.
          enum:
            - present
            - none
            - unknown
            - not_applicable
          type: string
        config_source:
          type: string
        created_at:
          format: date-time
          type: string
        deployments:
          allOf:
            - description: >-
                Deployments at the current or frozen head; display-only,
                independent of checks and merge gates.
            - $ref: '#/components/schemas/TrailDeployments'
        gh_pr_id:
          format: int64
          type: integer
        has_code_changes:
          type: boolean
        head_sha:
          type:
            - string
            - 'null'
        id:
          type: string
        last_activity_at:
          description: >-
            Latest meaningful activity on the Change; excludes background
            bookkeeping and falls back to created_at until activity is recorded.
          format: date-time
          type: string
        lifecycle_sync:
          description: >-
            Pending means linked PR metadata reports a terminal transition not
            yet applied to this Change, or the linked PR's head branch was
            deleted. Settled means no such observed transition, not a guarantee
            that all webhooks have arrived.
          enum:
            - settled
            - pending
          type: string
        merge_base_sha:
          type:
            - string
            - 'null'
        mergeability:
          $ref: '#/components/schemas/TrailMergeabilityResponse'
        merged_at:
          format: date-time
          type:
            - string
            - 'null'
        merged_base:
          description: >-
            Branch a merged Change landed on, as its merge recorded it, without
            refs/heads/. Merged through Entire, a stacked Change names its
            stack's base, not its own base; merged on GitHub, it names the base
            GitHub reported for the pull request. Omitted when the Change is not
            merged or its merge recorded no destination, as for merges that
            predate the record.
          type: string
        monitors:
          items:
            $ref: '#/components/schemas/TrailMonitorItemJSON'
          type:
            - array
            - 'null'
        number:
          format: int64
          type: integer
        original_branch:
          type:
            - string
            - 'null'
        parent:
          allOf:
            - description: >-
                Discoverable project parent on list/detail reads; absence does
                not prove the work is parentless
            - $ref: '#/components/schemas/TrailParentReference'
        ready_for_review:
          type: boolean
        reviewers:
          items:
            $ref: '#/components/schemas/TrailReviewer'
          type:
            - array
            - 'null'
        runners:
          items:
            $ref: '#/components/schemas/TrailRunnerItemJSON'
          type:
            - array
            - 'null'
        status:
          type: string
        title:
          type: string
        updated_at:
          format: date-time
          type: string
        url:
          description: >-
            Web app page for this code work; absent when this deployment has no
            frontend origin
          type: string
      required:
        - body_document
        - monitors
        - agents
        - runners
        - actions
        - mergeability
        - config_source
        - merge_base_sha
        - base_sha
        - head_sha
        - id
        - number
        - title
        - status
        - branch
        - original_branch
        - base
        - author
        - reviewers
        - ready_for_review
        - has_code_changes
        - created_at
        - updated_at
        - merged_at
        - last_activity_at
        - branch_state
        - code_changes
        - lifecycle_sync
        - base_missing
      type: object
    ProblemDocument:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/ProblemDocument.json
          format: uri
          readOnly: true
          type: string
        code:
          description: Stable error code; see https://entire.com/errors/.
          type: string
        detail:
          description: Human-readable explanation; server errors omit internal details.
          type: string
        request_id:
          description: Request identifier correlated with server logs.
          minLength: 1
          type: string
        status:
          description: HTTP response status.
          format: int64
          maximum: 599
          minimum: 400
          type: integer
        title:
          description: Short description of the HTTP error.
          type: string
        type:
          description: Documentation URL for this error code.
          format: uri
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      type: object
    TrailActions:
      additionalProperties: false
      properties:
        approve:
          $ref: '#/components/schemas/TrailActionAvailability'
        create_ci_pr:
          $ref: '#/components/schemas/TrailActionAvailability'
        delete_branch:
          $ref: '#/components/schemas/TrailActionAvailability'
        merge:
          $ref: '#/components/schemas/TrailActionAvailability'
        merge_with_bypass:
          $ref: '#/components/schemas/TrailActionAvailability'
        restore_branch:
          $ref: '#/components/schemas/TrailActionAvailability'
        update_branch:
          $ref: '#/components/schemas/TrailActionAvailability'
      required:
        - approve
        - create_ci_pr
        - merge
        - merge_with_bypass
        - update_branch
        - restore_branch
        - delete_branch
      type: object
    TrailAgentJSON:
      additionalProperties: false
      properties:
        agent:
          $ref: '#/components/schemas/TrailAgentRefJSON'
        history:
          description: >-
            At most six entries, newest first. By default, finished readings of
            the current value type. With agent_history=runs, includes preserved
            canceled runs and a kind discriminator on every entry.
          items:
            $ref: '#/components/schemas/TrailAgentHistoryEntryJSON'
          type:
            - array
            - 'null'
        latest_run:
          allOf:
            - description: >-
                The agent's latest run on the Change, finished or not; null
                while it waits for its first.
            - $ref: '#/components/schemas/TrailAgentRunJSON'
        reading:
          allOf:
            - description: >-
                The latest finished reading of the signal's current value type;
                null until one exists.
            - $ref: '#/components/schemas/TrailAgentReadingJSON'
        signal:
          allOf:
            - description: >-
                The signal its latest run reports, or a waiting agent's own: its
                review distilled into one reading.
            - $ref: '#/components/schemas/AgentSignal'
        trend_delta:
          description: >-
            The reading minus the one before it (percent points, or steps of
            small/medium/large, false/true); null without two. Canceled entries
            do not contribute.
          format: int64
          type:
            - integer
            - 'null'
        waiting_for:
          description: >-
            Set while the agent has no run on the Change: ready, it runs once
            the Change is ready for review; not_ready, it runs only before the
            Change is ready for review, so not on this one while it stays ready;
            push, it runs on the next push (or run it now).
          enum:
            - ready
            - not_ready
            - push
          type:
            - string
            - 'null'
      required:
        - agent
        - signal
        - reading
        - trend_delta
        - latest_run
        - waiting_for
        - history
      type: object
    TrailAuthor:
      additionalProperties: false
      properties:
        id:
          type: string
        identity:
          $ref: '#/components/schemas/ContributorIdentity'
        login:
          type:
            - string
            - 'null'
      required:
        - id
        - login
        - identity
      type: object
    TrailBodyDocumentJSON:
      additionalProperties: false
      properties:
        content_json: {}
        document_key:
          type: string
        etag:
          type: string
        id:
          type: string
        schema_version:
          format: int64
          type: integer
        text_snapshot:
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - id
        - document_key
        - schema_version
        - content_json
        - text_snapshot
        - updated_at
        - etag
      type: object
    TrailDeployments:
      additionalProperties: false
      properties:
        availability:
          description: >-
            available: read succeeded (possibly empty). unavailable: the read
            failed; not zero deployments. not_applicable: no head SHA.
          enum:
            - available
            - unavailable
            - not_applicable
          type: string
        items:
          description: Latest resource per plugin and key on this SHA; always an array.
          items:
            $ref: '#/components/schemas/TrailDeployment'
          type:
            - array
            - 'null'
        ready:
          description: Resources completed with conclusion success.
          format: int64
          type: integer
        total:
          description: >-
            Resources that can become ready: skipped and inactive ones are
            excluded, so ready can reach total.
          format: int64
          type: integer
      required:
        - items
        - availability
        - ready
        - total
      type: object
    TrailMergeabilityResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/TrailMergeabilityResponse.json
          format: uri
          readOnly: true
          type: string
        behind_by:
          format: int64
          type: integer
        bypass_policy:
          description: >-
            Effective bypass policy for this response. When readiness is
            unavailable, nobody is a fail-closed fallback, not the saved
            repository setting; merge actions remain unavailable.
          type: string
        checks:
          allOf:
            - description: >-
                Third-party CI runs for headSha from the same read that
                evaluated the checks gate; Entire's own gate rollup is excluded.
                On an open native trail whose checks gate is pending, each
                required name with no report is also listed, with status queued
                and no started_at, whatever checks.availability says. Reported
                runs are meaningful only when checks.availability is available.
            - $ref: '#/components/schemas/TrailChecksJSON'
        comparison_status:
          type: string
        conflict_status:
          description: >-
            Provider conflict verdict for headSha; mergeable requires clean,
            independently of gates and CI evidence. The merge action is blocked
            only by conflicting: an unknown verdict leaves conflicts to the
            forge's merge.
          enum:
            - clean
            - conflicting
            - unknown
          type: string
        delete_branch_on_merge:
          description: >-
            Default for the merge request's deleteBranch option, i.e. the
            repository's delete-branch-on-merge setting; false means the setting
            is off. Null for a GitHub-backed repository, where entire-api never
            deletes the branch, and when readiness is unavailable.
          type:
            - boolean
            - 'null'
        forge_merge_block:
          allOf:
            - description: >-
                Set when the forge's own branch rules (GitHub branch protection
                or rulesets) refuse the merge at headSha, independent of
                Entire's gates. Read under the GitHub App's credential, so it
                does not reflect a viewer's ability to bypass. Null when not
                blocked or unknown, and when GitHub waits only on Entire's own
                gates check run, which the gates already report.
            - $ref: '#/components/schemas/ForgeMergeBlockJSON'
        gates:
          items:
            $ref: '#/components/schemas/GateResult'
          type:
            - array
            - 'null'
        head_sha:
          type:
            - string
            - 'null'
        mergeable:
          type: boolean
      required:
        - delete_branch_on_merge
        - bypass_policy
        - mergeable
        - behind_by
        - comparison_status
        - conflict_status
        - head_sha
        - gates
        - checks
        - forge_merge_block
      type: object
    TrailMonitorItemJSON:
      additionalProperties: false
      properties:
        boolean_value:
          type:
            - boolean
            - 'null'
        evaluated_at_sha:
          type:
            - string
            - 'null'
        evaluating:
          type: boolean
        head_sha:
          type:
            - string
            - 'null'
        history:
          items:
            $ref: '#/components/schemas/TrailMonitorHistoryItemJSON'
          type:
            - array
            - 'null'
        key:
          type: string
        label:
          type: string
        last_failed_attempt:
          $ref: '#/components/schemas/TrailMonitorFailedAttemptJSON'
        outcome:
          type:
            - string
            - 'null'
        percent_value:
          format: int64
          type:
            - integer
            - 'null'
        polarity:
          type:
            - string
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        run_id:
          type: string
        size_value:
          type:
            - string
            - 'null'
        stale_reason:
          type:
            - string
            - 'null'
        state:
          type: string
        trend_delta:
          format: int64
          type:
            - integer
            - 'null'
        updated_at:
          format: date-time
          type: string
        value_type:
          type: string
      required:
        - key
        - label
        - value_type
        - percent_value
        - size_value
        - boolean_value
        - rationale
        - polarity
        - trend_delta
        - evaluating
        - last_failed_attempt
        - history
        - run_id
        - head_sha
        - updated_at
        - state
        - outcome
        - stale_reason
        - evaluated_at_sha
      type: object
    TrailParentReference:
      additionalProperties: false
      properties:
        host:
          enum:
            - gh
            - et
          type: string
        id:
          type: string
        jurisdiction:
          description: Project jurisdiction from Core; empty when unresolved
          type: string
        number:
          description: Project-local Trail number, not the repository Trail number
          format: int64
          type: integer
        path:
          description: API-relative parent detail path in the project's cell
          type: string
        primary_processing_cell:
          description: >-
            Project cell ID from Core; empty when unassigned (do not infer from
            the repository)
          type: string
        project:
          description: Canonical public project name, never its internal storage name
          type: string
        project_id:
          type: string
        url:
          description: >-
            Web app page for the parent Trail; absent when this deployment has
            no frontend origin
          type: string
      required:
        - id
        - number
        - project_id
        - host
        - project
        - path
        - jurisdiction
        - primary_processing_cell
      type: object
    TrailReviewer:
      additionalProperties: false
      properties:
        actor_account_id:
          type: string
        identity:
          $ref: '#/components/schemas/ContributorIdentity'
        is_approval_stale:
          type: boolean
        login:
          type: string
        status:
          type: string
      required:
        - login
        - status
        - identity
      type: object
    TrailRunnerItemJSON:
      additionalProperties: false
      properties:
        evaluated_at_sha:
          type:
            - string
            - 'null'
        outcome:
          type:
            - string
            - 'null'
        run_id:
          type:
            - string
            - 'null'
        runner_id:
          type: string
        stale_reason:
          type:
            - string
            - 'null'
        started_at:
          format: date-time
          type:
            - string
            - 'null'
        state:
          type: string
      required:
        - runner_id
        - state
        - outcome
        - run_id
        - evaluated_at_sha
        - started_at
        - stale_reason
      type: object
    TrailActionAvailability:
      additionalProperties: false
      properties:
        reason:
          type:
            - string
            - 'null'
        state:
          enum:
            - enabled
            - blocked
            - unavailable
          type: string
      required:
        - state
        - reason
      type: object
    TrailAgentRefJSON:
      additionalProperties: false
      properties:
        id:
          description: >-
            Agent id (GET .../agents/{id}); stable across every edit of the
            agent.
          type: string
        name:
          description: The agent's current name.
          type: string
        preset:
          allOf:
            - description: >-
                The Entire preset the agent runs now, or null for a custom
                agent.
            - $ref: '#/components/schemas/AgentPresetRef'
      required:
        - id
        - name
        - preset
      type: object
    TrailAgentHistoryEntryJSON:
      additionalProperties: false
      properties:
        boolean_value:
          type:
            - boolean
            - 'null'
        head_sha:
          description: The head it reviewed.
          type:
            - string
            - 'null'
        kind:
          description: >-
            reading = a succeeded run that produced a signal value; canceled = a
            canceled run preserved on the chart.
          enum:
            - reading
            - canceled
          type: string
        percent_value:
          format: int64
          type:
            - integer
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        run_id:
          description: The run that produced it.
          type: string
        size_value:
          enum:
            - small
            - medium
            - large
          type:
            - string
            - 'null'
        summary:
          description: The review as a whole; null for a result from before summaries.
          type:
            - string
            - 'null'
        updated_at:
          format: date-time
          type: string
        verdicts:
          allOf:
            - description: The run's verdicts on the agent's earlier open findings.
            - $ref: '#/components/schemas/TrailAgentVerdictsJSON'
      required:
        - percent_value
        - size_value
        - boolean_value
        - rationale
        - summary
        - verdicts
        - run_id
        - head_sha
        - updated_at
      type: object
    TrailAgentRunJSON:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        error:
          allOf:
            - description: Why the run failed or timed out; null otherwise.
            - $ref: '#/components/schemas/RunError'
        head_sha:
          type:
            - string
            - 'null'
        id:
          description: The run (GET .../runs/{id}).
          type: string
        status:
          enum:
            - queued
            - running
            - succeeded
            - failed
            - timed_out
            - canceled
          type: string
      required:
        - id
        - status
        - head_sha
        - created_at
        - error
      type: object
    TrailAgentReadingJSON:
      additionalProperties: false
      properties:
        boolean_value:
          type:
            - boolean
            - 'null'
        head_sha:
          description: The head it reviewed.
          type:
            - string
            - 'null'
        percent_value:
          format: int64
          type:
            - integer
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        run_id:
          description: The run that produced it.
          type: string
        size_value:
          enum:
            - small
            - medium
            - large
          type:
            - string
            - 'null'
        summary:
          description: The review as a whole; null for a result from before summaries.
          type:
            - string
            - 'null'
        updated_at:
          format: date-time
          type: string
        verdicts:
          allOf:
            - description: The run's verdicts on the agent's earlier open findings.
            - $ref: '#/components/schemas/TrailAgentVerdictsJSON'
      required:
        - percent_value
        - size_value
        - boolean_value
        - rationale
        - summary
        - verdicts
        - run_id
        - head_sha
        - updated_at
      type: object
    AgentSignal:
      additionalProperties: false
      properties:
        polarity:
          description: Which readings are good.
          enum:
            - higher_is_better
            - lower_is_better
            - neutral
          type: string
        value_type:
          description: >-
            boolean (true/false), percent (0-100) or size (small, medium,
            large).
          enum:
            - boolean
            - percent
            - size
          type: string
      required:
        - value_type
        - polarity
      type: object
    ContributorIdentity:
      additionalProperties: false
      properties:
        account_id:
          type:
            - string
            - 'null'
        agent:
          allOf:
            - description: >-
                The saved Agent that acted (GET .../agents/{id}), by its current
                name; display_name is that name too.
            - $ref: '#/components/schemas/AgentNameJSON'
        automation:
          $ref: '#/components/schemas/AutomationIdentity'
        avatar_url:
          type:
            - string
            - 'null'
        display_name:
          type:
            - string
            - 'null'
        handles:
          items:
            $ref: '#/components/schemas/IdentityHandle'
          type:
            - array
            - 'null'
        kind:
          type: string
        run_id:
          description: The agent run that acted (GET .../runs/{id}).
          type: string
        username:
          type: string
      required:
        - kind
        - account_id
        - display_name
        - avatar_url
        - handles
      type: object
    TrailDeployment:
      additionalProperties: false
      properties:
        completed_at:
          format: date-time
          type: string
        conclusion:
          enum:
            - success
            - failure
            - cancelled
            - skipped
          type: string
        deadline_at:
          format: date-time
          type: string
        environment:
          description: Defaults to preview; the only documented environment in v0.
          maxLength: 64
          type: string
        environment_url:
          maxLength: 2048
          type: string
        external_updated_at:
          format: date-time
          type: string
        group:
          $ref: '#/components/schemas/DeploymentGroup'
        id:
          type: string
        key:
          description: >-
            Stable resource id, unique per plugin and commit. At most 255
            characters.
          maxLength: 255
          type: string
        logs_url:
          maxLength: 2048
          type: string
        name:
          maxLength: 255
          type: string
        plugin:
          type: string
        stale:
          description: >-
            queued or in_progress past deadline_at; the reported status is
            unchanged.
          type: boolean
        started_at:
          format: date-time
          type: string
        status:
          description: >-
            inactive: the resource no longer exists, such as a torn-down
            preview; do not offer its links.
          enum:
            - queued
            - in_progress
            - completed
            - inactive
          type: string
        type:
          maxLength: 64
          type: string
      required:
        - stale
        - id
        - plugin
        - key
        - name
        - status
        - external_updated_at
      type: object
    TrailChecksJSON:
      additionalProperties: false
      properties:
        availability:
          description: >-
            available means a complete read, including an empty list;
            unavailable means missing or failed evidence; not_applicable means
            no applicable CI evidence.
          enum:
            - available
            - unavailable
            - not_applicable
          type: string
        runs:
          items:
            $ref: '#/components/schemas/TrailCheckRunJSON'
          type:
            - array
            - 'null'
      required:
        - availability
        - runs
      type: object
    ForgeMergeBlockJSON:
      additionalProperties: false
      properties:
        reason:
          description: >-
            Open set: review_required means GitHub needs an approving review;
            changes_requested means a GitHub reviewer requested changes;
            checks_pending means a required check on headSha has not finished;
            blocked means GitHub reports the merge as blocked without naming a
            readable rule. Unknown future values must be tolerated.
          type: string
          x-open-enum:
            - review_required
            - changes_requested
            - checks_pending
            - blocked
        required_approving_review_count:
          description: Approving reviews GitHub requires; 0 when GitHub did not say.
          format: int64
          type: integer
      required:
        - reason
        - required_approving_review_count
      type: object
    GateResult:
      additionalProperties: false
      properties:
        blocking:
          type: boolean
        completed_at:
          format: date-time
          type:
            - string
            - 'null'
        created_at:
          format: date-time
          type: string
        evaluated_at_sha:
          type:
            - string
            - 'null'
        finding_count:
          format: int64
          type:
            - integer
            - 'null'
        gate_definition_id:
          type: string
        gate_key:
          type: string
        gate_type:
          type: string
        head_sha:
          type:
            - string
            - 'null'
        id:
          type: string
        not_applicable_reason:
          description: >-
            Machine-readable reason for a not_applicable gate. no_changes means
            the branch has no changes from its base; it is not an evaluated
            skipped verdict. Absent for other results, including disabled gates.
          enum:
            - no_changes
          type: string
        outcome:
          type:
            - string
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        reviewers:
          items:
            $ref: '#/components/schemas/ApprovalReviewer'
          type: array
        runner_ids:
          description: >-
            Sorted unique runner IDs contributing to this gate, drawn from the
            Trail detail runners array. Empty when none are associated or
            configuration is unavailable.
          items:
            type: string
          type: array
          uniqueItems: true
        stale_reason:
          type:
            - string
            - 'null'
        state:
          type: string
        status:
          type: string
        value: {}
      required:
        - reviewers
        - runner_ids
        - id
        - gate_definition_id
        - gate_key
        - gate_type
        - blocking
        - status
        - head_sha
        - value
        - rationale
        - created_at
        - completed_at
        - outcome
        - stale_reason
        - evaluated_at_sha
        - finding_count
      type: object
    TrailMonitorHistoryItemJSON:
      additionalProperties: false
      properties:
        boolean_value:
          type:
            - boolean
            - 'null'
        evaluating:
          type: boolean
        head_sha:
          type:
            - string
            - 'null'
        percent_value:
          format: int64
          type:
            - integer
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        run_id:
          type: string
        size_value:
          type:
            - string
            - 'null'
        updated_at:
          format: date-time
          type: string
      required:
        - percent_value
        - size_value
        - boolean_value
        - rationale
        - run_id
        - head_sha
        - updated_at
      type: object
    TrailMonitorFailedAttemptJSON:
      additionalProperties: false
      properties:
        failed_at:
          format: date-time
          type: string
        head_sha:
          type:
            - string
            - 'null'
        run_id:
          type: string
      required:
        - run_id
        - head_sha
        - failed_at
      type: object
    AgentPresetRef:
      additionalProperties: false
      properties:
        id:
          description: Preset id (GET /agents/presets).
          type: string
        version:
          description: >-
            The preset's current version: what the agent's next run will run. A
            run records the version it ran.
          format: int64
          minimum: 1
          type: integer
      required:
        - id
        - version
      type: object
    TrailAgentVerdictsJSON:
      additionalProperties: false
      properties:
        decided_by_person:
          description: >-
            Verdicts a person's decision overrode (already_closed,
            reopened_by_person); not counted above.
          format: int64
          type: integer
        fixed:
          format: int64
          type: integer
        no_longer_applies:
          format: int64
          type: integer
        still_present:
          format: int64
          type: integer
      required:
        - fixed
        - still_present
        - no_longer_applies
        - decided_by_person
      type: object
    RunError:
      additionalProperties: false
      properties:
        code:
          description: >-
            Set when the run was refused for billing: billing_trial_ended,
            billing_credit_exhausted, billing_over_limit, billing_blocked,
            billing_not_enrolled or billing_no_paid_balance; null otherwise.
          type:
            - string
            - 'null'
        message:
          type: string
      required:
        - code
        - message
      type: object
    AgentNameJSON:
      additionalProperties: false
      properties:
        id:
          description: Agent id (GET .../agents/{id}).
          type: string
        name:
          description: The agent's current name.
          type: string
      required:
        - id
        - name
      type: object
    AutomationIdentity:
      additionalProperties: false
      properties:
        automation_id:
          description: >-
            The automation's aut_<ULID> subject, for an automation that is not a
            plugin installation.
          type: string
        installation_id:
          description: The plugin installation's ins_<ULID> id.
          type: string
        plugin:
          description: The plugin's slug.
          type: string
      type: object
    IdentityHandle:
      additionalProperties: false
      properties:
        handle:
          type: string
        is_primary:
          type: boolean
        provider:
          type: string
      required:
        - provider
        - handle
      type: object
    DeploymentGroup:
      additionalProperties: false
      properties:
        key:
          maxLength: 255
          type: string
        name:
          maxLength: 255
          type: string
      required:
        - key
        - name
      type: object
    TrailCheckRunJSON:
      additionalProperties: false
      properties:
        app_name:
          type:
            - string
            - 'null'
        completed_at:
          format: date-time
          type:
            - string
            - 'null'
        conclusion:
          type:
            - string
            - 'null'
        details_url:
          type:
            - string
            - 'null'
        name:
          type: string
        source:
          description: >-
            Slug of the CI plugin that reported this run. Absent for a run read
            from the forge.
          type: string
        started_at:
          format: date-time
          type:
            - string
            - 'null'
        status:
          type: string
        steps:
          items:
            $ref: '#/components/schemas/CheckRunStep'
          type:
            - array
            - 'null'
      required:
        - name
        - status
        - conclusion
        - details_url
        - started_at
        - completed_at
        - app_name
      type: object
    ApprovalReviewer:
      additionalProperties: false
      properties:
        actor_account_id:
          type: string
        login:
          type: string
        reason:
          type:
            - string
            - 'null'
        reviewed_head_sha:
          type:
            - string
            - 'null'
        state:
          enum:
            - pending
            - approved
            - stale
            - changes_requested
            - excluded
          type: string
      required:
        - login
        - state
        - reviewed_head_sha
        - reason
      type: object
    CheckRunStep:
      additionalProperties: false
      properties:
        conclusion:
          type:
            - string
            - 'null'
        exit_status:
          format: int64
          type: integer
        id:
          type: string
        name:
          type: string
        status:
          type: string
      required:
        - id
        - name
        - status
        - conclusion
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: >-
        Bearer token authorizing this operation's repository action. Each
        operation's security requirement names the resource action the token
        must be authorized for (pull or push).
      scheme: bearer
      type: http
    oauth2:
      description: OAuth 2.0 authorization code flow.
      flows:
        authorizationCode:
          authorizationUrl: https://us.auth.entire.io/authorize
          scopes:
            offline_access: Stay signed in and receive a refresh token.
            openid: Verify your identity.
          tokenUrl: https://us.auth.entire.io/oauth/token
      type: oauth2
    oidc:
      description: >-
        OpenID Connect discovery document:
        https://us.auth.entire.io/.well-known/openid-configuration
      openIdConnectUrl: https://us.auth.entire.io/.well-known/openid-configuration
      type: openIdConnect

````