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

# Get a run job (status, episodes, gates)

> Poll a run job created by POST /api/workbench/campaigns/{campaign_id}/runs. NOTE the path: run jobs live under the shared `/api/aug` job engine on the same host, not under `/api/workbench`. Same bearer auth and owner scoping (another user's job reads as 404). Each episode carries the MACHINE gate verdict (`accept`/`reject`) plus the gate numbers the campaign's review step confirms or overrules.




## OpenAPI

````yaml /forge-api-v1.yaml get /api/aug/jobs/{job_id}
openapi: 3.0.3
info:
  title: Alakazam Forge API
  version: '1.0'
  description: |
    The Forge Dataset Workbench API: upload or import robotics datasets,
    audit them, propose and run augmentation campaigns, review, and deliver.
    Served by the Forge workbench service at forge.alakazam.gg (not
    api.alakazam.gg).
servers:
  - url: https://forge.alakazam.gg
    description: Forge (Dataset Workbench)
security: []
tags:
  - name: Dataset Workbench
    description: |
      **Served at `https://forge.alakazam.gg`** (not the main API host). The
      Forge Dataset Workbench is the client surface of the robotics
      data-augmentation service: bring a LeRobot robot dataset, a public
      Hugging Face repo, a resumable chunked upload, or a one-click curated
      sample, and walk one owner-scoped **campaign** through the spine
      Source & Health → Sample → Transform → Run + Verify → Deliver, leaving
      with a verified augmented dataset. Every endpoint requires a **Supabase
      user access token** (`Authorization: Bearer …`, the `UserAuth` scheme);
      a missing or invalid token returns `401`, and another user's campaigns,
      runs, and uploads read as `404`. Errors use the platform envelope
      `{"detail": "…"}`. Nothing bills until **Deliver**, which charges 1
      credit per never-before-billed kept episode from your credits wallet.
  - name: Playground batches
    description: |
      The Forge playground's "describe a change" flow is not a REST surface on
      this host: a described change is submitted as a **scenario batch**
      through the platform (the Supabase RPC `create_scenario_batch`) and its
      progress/results stream back over Supabase realtime on the
      `scenario_batches` table. For the equivalent public REST surface, see
      **Scenario Studio** (`/v1/scenario-batches`).
paths:
  /api/aug/jobs/{job_id}:
    servers:
      - url: https://forge.alakazam.gg
        description: Forge (Dataset Workbench)
    get:
      tags:
        - Dataset Workbench
      summary: Get a run job (status, episodes, gates)
      description: >
        Poll a run job created by POST
        /api/workbench/campaigns/{campaign_id}/runs. NOTE the path: run jobs
        live under the shared `/api/aug` job engine on the same host, not under
        `/api/workbench`. Same bearer auth and owner scoping (another user's job
        reads as 404). Each episode carries the MACHINE gate verdict
        (`accept`/`reject`) plus the gate numbers the campaign's review step
        confirms or overrules.
      parameters:
        - name: job_id
          in: path
          required: true
          schema:
            type: string
            example: aug_9f8e7d6c5b4a
      responses:
        '200':
          description: The job
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AugJob'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Job not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - UserAuth: []
components:
  schemas:
    AugJob:
      type: object
      description: >
        One augmentation run job (mine → compose → render → gate). A campaign
        run (POST /api/workbench/campaigns/{campaign_id}/runs) creates one; poll
        it at GET /api/aug/jobs/{job_id} until `status` settles.
      properties:
        job_id:
          type: string
          example: aug_9f8e7d6c5b4a
        engine:
          type: string
        dataset_id:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
        stage:
          type: string
          enum:
            - mine
            - compose
            - render
            - gate
            - done
          description: Current pipeline stage.
        error:
          type: string
          nullable: true
        progress:
          type: object
          description: Monotonic counters over the run's candidates.
          properties:
            candidates:
              type: integer
            composed:
              type: integer
            rendered:
              type: integer
            gated:
              type: integer
            accepted:
              type: integer
            rejected:
              type: integer
        episodes:
          type: array
          items:
            $ref: '#/components/schemas/AugJobEpisode'
        head_stats:
          type: object
          description: >-
            Per-head accept/reject yield for THIS run ({head episode: {accepted,
            rejected}}).
          additionalProperties:
            type: object
            properties:
              accepted:
                type: integer
              rejected:
                type: integer
        created_utc:
          type: string
          format: date-time
        updated_utc:
          type: string
          format: date-time
    Error:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message.
        errors:
          type: array
          items:
            type: string
          description: Field-level validation errors (e.g. on 422 from POST /v1/worlds).
        schemaVersion:
          type: string
      required:
        - detail
    AugJobEpisode:
      type: object
      description: >-
        One generated episode within a run job. `status` accept/reject is the
        MACHINE gate verdict; the campaign review step confirms or overrules it.
      properties:
        name:
          type: string
          description: Episode name, the key review verdicts and delivery use.
        status:
          type: string
          enum:
            - pending
            - rendering
            - accept
            - reject
        source_head:
          type: integer
          nullable: true
          description: Head (approach) source episode.
        source_tail:
          type: integer
          nullable: true
          description: Tail (placement) source episode.
        divergence:
          type: number
        end_divergence:
          type: number
        gates:
          type: object
          description: The IDM + task gate numbers behind the verdict.
          properties:
            ratio:
              type: number
              description: Post/pre IDM error ratio (accept requires ≤ the engine bound).
            corr:
              type: number
              description: IDM action correlation (accept requires ≥ the engine bound).
            mae:
              type: number
              description: IDM mean absolute error (accept requires ≤ the engine bound).
            task_ok:
              type: boolean
              description: >-
                Task-completion gate verdict (an abstain counts as ok but is
                recorded as not-ran).
            task_ran:
              type: boolean
            drift_frames:
              type: integer
              description: Identity-drift frames detected (accept requires 0).
        video:
          type: string
          nullable: true
          description: >-
            Job-relative artifact path (`files/…`) of the rendered clip, fetch
            it via GET /api/aug/jobs/{job_id}/{video}.
        idm_series:
          type: string
          nullable: true
          description: >-
            Job-relative path of the per-frame IDM MAE series (a bare JSON
            number array).
        viz_png:
          type: string
          nullable: true
          description: Job-relative path of the gate visualization still.
        error:
          type: string
          nullable: true
          description: Present when a render/assembly failure auto-rejected the episode.
  securitySchemes:
    UserAuth:
      type: http
      scheme: bearer
      description: >
        Either a Supabase user access token (from a password login, or the
        passwordless magic-link flow) or a long-lived `forge_sk_…` API key. Both
        are sent as `Authorization: Bearer <value>` and resolve to the same
        owner, so every endpoint accepts either. Session tokens expire in ~1h;
        API keys do not expire and are the credential for MCP clients, CI, and
        partner integrations.

````