openapi: 3.1.0
info:
  title: RTT/1 Diagnostic API
  version: 1.0.0-alpha
  description: >
    Canonical RTT/1 diagnostic engine API surface.
    Produces issues, warnings, and stats for any input payload.

servers:
  - url: local
    description: Local execution (browser or worker)

paths:
  /diagnostics:
    post:
      summary: Generate RTT/1 diagnostics
      operationId: diagnostics
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/DiagnosticInput"
      responses:
        "200":
          description: RTT/1 diagnostic output
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/DiagnosticOutput"

components:
  schemas:

    DiagnosticInput:
      type: object
      description: Arbitrary RTT/1 input payload.
      additionalProperties: true

    DiagnosticOutput:
      type: object
      required: ["issues", "warnings", "stats"]
      properties:
        issues:
          type: array
          items: { type: "string" }
        warnings:
          type: array
          items: { type: "string" }
        stats:
          type: object
          required: ["timestamp", "length"]
          properties:
            timestamp: { type: "number" }
            length: { type: "number" }

    ErrorOutput:
      type: object
      properties:
        error: { type: "string" }

