openapi: 3.1.0
info:
  title: Tenant Registry Recovery Triage Route Contract
  version: 0.1.0
  summary: Internal navigation contract for workspace backup and recovery drilldowns into the tenant registry.

servers:
  - url: /

paths:
  /admin/tenants:
    get:
      operationId: openTenantRegistryTriage
      summary: Open the tenant registry with exact triage intent preserved.
      description: |
        Multi-tenant workspace backup and recovery drilldowns open this route with exact posture filter semantics.
        The route renders HTML, stays scoped to the current visible workspace slice, and must not reveal out-of-scope tenants.
      parameters:
        - name: backup_posture
          in: query
          required: false
          description: Exact backup-posture filter values to apply on initial registry load.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - absent
                - stale
                - degraded
                - healthy
        - name: recovery_evidence
          in: query
          required: false
          description: Exact recovery-evidence filter values to apply on initial registry load.
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
              enum:
                - weakened
                - unvalidated
                - no_recent_issues_visible
        - name: triage_sort
          in: query
          required: false
          description: Optional registry ordering mode. Workspace drilldowns default to worst-first.
          schema:
            type: string
            enum:
              - default
              - worst_first
      responses:
        '200':
          description: Tenant registry HTML rendered with the requested exact triage intent over the visible tenant set.
          content:
            text/html:
              schema:
                type: string
        '404':
          description: Workspace scope or tenant visibility is not established.

  /admin/t/{tenant}:
    get:
      operationId: openSingleTenantDashboardTriage
      summary: Open the tenant dashboard as the single-tenant triage destination.
      description: |
        Workspace backup or recovery drilldowns may resolve directly here when exactly one visible tenant is affected.
        This route remains the canonical safe fallback when deeper backup or restore surfaces are not appropriate.
      parameters:
        - name: tenant
          in: path
          required: true
          description: Tenant external route key.
          schema:
            type: string
      responses:
        '200':
          description: Tenant dashboard HTML rendered inside the current workspace and tenant scope.
          content:
            text/html:
              schema:
                type: string
        '404':
          description: Tenant is not visible in the current workspace or the actor is not a member.

components:
  schemas:
    TenantRegistryTriageIntent:
      type: object
      additionalProperties: false
      properties:
        backup_posture:
          type: array
          items:
            type: string
            enum:
              - absent
              - stale
              - degraded
              - healthy
        recovery_evidence:
          type: array
          items:
            type: string
            enum:
              - weakened
              - unvalidated
              - no_recent_issues_visible
        triage_sort:
          type: string
          enum:
            - default
            - worst_first
      description: Exact filter and ordering intent used to open the tenant registry in recovery-triage mode.