openapi: 3.1.0
info:
  title: RTT/2 Regime Map API
  version: "2026.1"
  description: >
    Computes regime weights, transitions, and intersections
    for the RTT/2 S/E/R structural model.

paths:
  /map:
    post:
      summary: Compute RTT/2 regime map
      operationId: regimeMap
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/RegimeMapInput"
      responses:
        "200":
          description: Successful regime map computation
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/RegimeMapOutput"

components:
  schemas:

    RegimeMapInput:
      type: object
      required: ["input"]
      properties:
        input:
          type: object
          description: Raw structural input for RTT/2 regime mapping.
          properties:
            structure:
              type: object
              properties:
                nodes:
                  type: array
                  items:
                    type: string
                edges:
                  type: array
                  items:
                    type: object
                    properties:
                      from: { type: string }
                      to: { type: string }
                      weight: { type: number }

    RegimeMapOutput:
      type: object
      properties:
        engine:
          type: string
          example: "RTT/2"
        operator:
          type: string
          example: "regime-map"
        version:
          type: string
          example: "2026.1"
        result:
          type: object
          properties:
            weights:
              type: object
              additionalProperties:
                type: object
                properties:
                  weight: { type: number }
            transitions:
              type: array
              items:
                type: object
                properties:
                  from: { type: string }
                  to: { type: string }
                  weight: { type: number }
            intersections:
              type: array
              items:
                type: object
                properties:
                  label: { type: string }
                  regimes:
                    type: array
                    items: { type: string }

