openapi: 3.0.3
info:
  title: Misfit Agent Evaluation Lab Public API
  version: 1.18.0
  description: >-
    Public-safe machine interface for the Misfit Agent Evaluation Lab. The product
    compares authorized Raw Agent, reconsidered, and GHOSBC-governed outcomes using
    bounded consequence assessment, Center Reset/replanning signals, public Castle
    Gate decision labels, Audit Memory completeness, comparative metrics, and
    deterministic report validation. Bounded AE100-v2 scoring is production-live.
    Purchase execution remains disabled under COMMERCIAL_HANDOFF_REVIEW_HOLD. This
    surface does not expose protected GHOSBC internals, execute external actions,
    charge payment methods, provide formal certification, claim machine consciousness,
    or imply independent third-party validation.
servers:
  - url: https://cibcxqrqiqvzpardbdrw.supabase.co/functions/v1/ghosbc-agent-evaluation-public
paths:
  /:
    get:
      operationId: getServiceDiscovery
      summary: Inspect current service health, capability availability, and machine-discovery metadata
      responses:
        '200':
          description: Service discovery metadata, including current scoring and purchase availability
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
    post:
      operationId: runAvailableEvaluationOperation
      summary: Run a currently available public-safe evaluation, discovery, or validation operation
      description: >-
        Bounded AE100-v2 scoring is production-live. Available public-safe operations
        include contract, benchmark_catalog_v2, score_report_v2, validate_report_v2,
        integration_quickstart, external_benchmark_bridge, and offer. Purchase
        availability is false and no purchase handoff is provided while
        COMMERCIAL_HANDOFF_REVIEW_HOLD is active.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AvailableOperationRequest'
            examples:
              contract:
                value:
                  op: contract
              benchmarkCatalogV2:
                value:
                  op: benchmark_catalog_v2
              scoreReportV2:
                value:
                  op: score_report_v2
              validateReportV2:
                value:
                  op: validate_report_v2
                  report:
                    contract_version: agent-evaluation-lab-v2
                    report_schema_version: agent-evaluation-report-v2.1
                    benchmark_version: ae100-v2
                    report_type: caller_supplied
                    comparative_summary:
                      raw_agent: {}
                      reconsidered_agent: {}
                      governed_agent: {}
                    evidence_rows: []
                    evidence_provenance:
                      classification: caller_supplied_unverified
                      externally_validated: false
                    claims_boundary: Not a certification or independent validation.
              quickstart:
                value:
                  op: integration_quickstart
              externalBridge:
                value:
                  op: external_benchmark_bridge
              offer:
                value:
                  op: offer
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
        '400':
          description: Invalid JSON, unknown operation, or invalid request shape
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: Requested capability is intentionally unavailable under a current canonical hold
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '413':
          description: Request payload too large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: Canonical evaluation service unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AvailableOperationRequest:
      type: object
      required:
        - op
      properties:
        op:
          type: string
          enum:
            - contract
            - benchmark_catalog_v2
            - score_report_v2
            - validate_report_v2
            - integration_quickstart
            - external_benchmark_bridge
            - offer
        report:
          type: object
          additionalProperties: true
      additionalProperties: true
    Error:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          enum: [false]
        error:
          type: string
      additionalProperties: true
