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

# Review an episode (confirm or overrule the machine verdict)

> Record a human verdict on one GENERATED episode of this campaign's runs: `confirm` keeps the machine gate verdict, `overrule` flips it (an accepted episode drops out of delivery; a rejected one is kept). Only graded episodes (machine status accept/reject) are reviewable ,  a pending or still-rendering episode returns 409. Unreviewed episodes trust the machine verdict at delivery. Reviewing is FREE, billing happens once, at deliver time.




## OpenAPI

````yaml /forge-api-v1.yaml post /api/workbench/campaigns/{campaign_id}/review
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/workbench/campaigns/{campaign_id}/review:
    servers:
      - url: https://forge.alakazam.gg
        description: Forge (Dataset Workbench)
    post:
      tags:
        - Dataset Workbench
      summary: Review an episode (confirm or overrule the machine verdict)
      description: >
        Record a human verdict on one GENERATED episode of this campaign's runs:
        `confirm` keeps the machine gate verdict, `overrule` flips it (an
        accepted episode drops out of delivery; a rejected one is kept). Only
        graded episodes (machine status accept/reject) are reviewable ,  a
        pending or still-rendering episode returns 409. Unreviewed episodes
        trust the machine verdict at delivery. Reviewing is FREE, billing
        happens once, at deliver time.
      parameters:
        - name: campaign_id
          in: path
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - episode
                - verdict
              properties:
                episode:
                  type: string
                  description: >-
                    The generated episode's `name` (from the run job's
                    episodes).
                verdict:
                  type: string
                  enum:
                    - confirm
                    - overrule
                note:
                  type: string
                  description: Optional reviewer note stored on the verdict.
      responses:
        '200':
          description: The updated campaign
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WorkbenchCampaign'
        '400':
          description: Verdict must be confirm or overrule
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            Campaign not found, or the episode is not part of this campaign's
            runs.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Episode is not graded yet, review it when verification finishes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - UserAuth: []
components:
  schemas:
    WorkbenchCampaign:
      type: object
      description: >
        A Dataset Workbench campaign (owner view): one walk of the augmentation
        spine over one source dataset. `stage` is the FURTHEST stage reached and
        never rolls back. Internal bookkeeping (owner, dataset/cache locations)
        is never surfaced. The set of already-billed episodes is tracked
        server-side but not exposed here, the deliver response reports how many
        episodes each delivery billed.
      properties:
        campaign_id:
          type: string
          example: camp_1f2e3d4c5b6a
        name:
          type: string
          description: >-
            Display name, the repo's last path segment, the sample's label, or
            the upload's campaign_name.
        repo_id:
          type: string
          description: >-
            The source dataset: a Hugging Face repo id, or the upload's name for
            uploaded datasets.
        engine:
          type: string
          description: >-
            The augmentation engine (embodiment + pipeline) this campaign runs
            on.
        stage:
          type: string
          enum:
            - source
            - sample
            - transform
            - run
            - deliver
          description: Furthest stage reached on the spine (monotonic).
        episodes:
          type: integer
          description: Episode count of the SOURCE dataset.
        health:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            The dataset health report once computed (null before): episode
            count, detected `classes` ({class: count}), the active
            `target_class` + `class_column`, `arm_split`, release stats, the
            `eligible_pool`, `exclusions`, and a motion-envelope `p99_summary`.
        health_status:
          type: string
          enum:
            - idle
            - computing
            - ready
            - failed
          description: >-
            Health lifecycle. `failed` carries no report; re-POST …/health to
            retry.
        sample:
          type: object
          nullable: true
          description: >-
            The saved sample (null until POST …/sample): the selected SOURCE
            episodes the transforms operate on.
          properties:
            selected:
              type: array
              items:
                type: integer
            count:
              type: integer
        plan:
          type: object
          nullable: true
          description: The saved transformation plan (null until POST …/plan).
          properties:
            transformations:
              type: array
              items:
                type: object
                additionalProperties: true
                description: >-
                  One transformation, e.g. { kind: "newtraj", params: {
                  n_candidates, n_target } }.
            saved_utc:
              type: string
              format: date-time
        run_ids:
          type: array
          items:
            type: string
          description: Run job ids, oldest first. Poll each at GET /api/aug/jobs/{job_id}.
        reviews:
          type: object
          description: >-
            Per-episode human verdicts, keyed by episode name: { verdict:
            confirm|overrule, by, at, note? }. Unreviewed episodes trust the
            machine gate verdict.
          additionalProperties:
            type: object
            properties:
              verdict:
                type: string
                enum:
                  - confirm
                  - overrule
              by:
                type: string
                example: owner
              at:
                type: string
                format: date-time
              note:
                type: string
        delivery:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Delivery state (null until POST …/deliver): `status` walks exporting
            → exported (→ publishing → published when a target_repo was given)
            or `failed` (with `error`), plus `export_dir`, `count`, the exported
            `episodes`, per-`families` counts, a `format_note`, and timestamps.
        dataset_source:
          type: string
          nullable: true
          description: >-
            `sample`, `upload`, or `remote_uri` (imported from
            S3/GCS/Azure/https via source_uri); absent for a plain Hugging Face
            repo campaign.
        provenance:
          type: object
          nullable: true
          additionalProperties: true
          description: >-
            Where the dataset came from, e.g. { source: sample, sample_id,
            opened_utc } or { source: upload, upload_id, manifest_sha, files,
            layout_notes, ingested_utc }.
        target_class:
          type: string
          nullable: true
          description: >-
            Per-campaign target-class override chosen via POST …/target (absent
            = the engine default).
        created_utc:
          type: string
          format: date-time
        updated_utc:
          type: string
          format: date-time
        cost:
          type: object
          description: Computed render spend across the campaign's runs.
          properties:
            renders:
              type: integer
            est_usd:
              type: number
        head_stats:
          type: object
          description: >-
            Cumulative per-head accept/reject yield across the campaign's prior
            runs ({head episode: {accepted, rejected}}), the learned-yield seed
            a top-up run carries forward.
          additionalProperties:
            type: object
            properties:
              accepted:
                type: integer
              rejected:
                type: integer
    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
  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.

````