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

# Repair Campaign History

> Rebuild the ``owners`` arrays an earlier migrate-board destroyed.

A one-shot repair for boards migrated before the migration learned to
remap history instead of emptying it. It replays each frame's surviving
``transfers`` to reconstruct the pre-migration board, proves each frame
against the ``territory`` counts that survived, and remaps the proven ones
onto the current grid — leaving anything it cannot prove empty rather than
inventing a war record (see campaign.migrate.reconstruct_owner_history).

Dry-run by default and idempotent: it only ever fills frames whose owners
are empty and never touches cells, epoch or the pending round, so it is
safe to run against a live league mid-war.



## OpenAPI

````yaml https://softmax.com/api/observatory/openapi.json post /v2/leagues/{league_id}/campaign/repair-history
openapi: 3.1.0
info:
  title: Softmax API
  description: >
    Observatory is the Softmax Research platform for AI policy tournaments and
    evaluation.

    Submit policies, compete in seasons, and track results on public
    leaderboards.


    ---


    ## Authentication


    Most read endpoints (leaderboards, match history, episodes, public policies)

    work without auth. Submitting policies or accessing your own data requires

    a Bearer token:


    ```

    Authorization: Bearer <your-token>

    ```


    To get a token, install [cogames](https://pypi.org/project/cogames/) and
    run:


    ```bash

    cogames auth login

    ```


    A `401` response means no token was provided. A `403` means the token

    is invalid or expired.


    ### Verify your token


    ```bash

    curl -H "Authorization: Bearer <your-token>" \
      https://softmax.com/api/observatory/whoami
    ```


    Returns `{"user_email": "you@example.com"}` on success.
  version: 1.0.0
servers:
  - url: https://softmax.com/api/observatory
security: []
paths:
  /v2/leagues/{league_id}/campaign/repair-history:
    post:
      tags:
        - v2
        - v2
      summary: Repair Campaign History
      description: >-
        Rebuild the ``owners`` arrays an earlier migrate-board destroyed.


        A one-shot repair for boards migrated before the migration learned to

        remap history instead of emptying it. It replays each frame's surviving

        ``transfers`` to reconstruct the pre-migration board, proves each frame

        against the ``territory`` counts that survived, and remaps the proven
        ones

        onto the current grid — leaving anything it cannot prove empty rather
        than

        inventing a war record (see campaign.migrate.reconstruct_owner_history).


        Dry-run by default and idempotent: it only ever fills frames whose
        owners

        are empty and never touches cells, epoch or the pending round, so it is

        safe to run against a live league mid-war.
      operationId: >-
        repair_campaign_history_v2_leagues__league_id__campaign_repair_history_post
      parameters:
        - name: league_id
          in: path
          required: true
          schema:
            type: string
            pattern: >-
              ^league_[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$
            title: League Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/RepairHistoryRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Repair Campaign History V2 Leagues  League Id 
                  Campaign Repair History Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - BearerAuth: []
components:
  schemas:
    RepairHistoryRequest:
      properties:
        dry_run:
          type: boolean
          title: Dry Run
          default: true
        old_width:
          anyOf:
            - type: integer
            - type: 'null'
          title: Old Width
        old_height:
          anyOf:
            - type: integer
            - type: 'null'
          title: Old Height
        old_shape:
          anyOf:
            - type: string
              enum:
                - square
                - hex
            - type: 'null'
          title: Old Shape
        allow_geometry_override:
          type: boolean
          title: Allow Geometry Override
          default: false
      additionalProperties: false
      type: object
      title: RepairHistoryRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token issued by Softmax

````