schema_version: 1
feature: operations-auto-refresh-pass
contracts:
  - name: tenantless-operation-run-viewer
    kind: ui-surface
    surface_class: App\Filament\Pages\Operations\TenantlessOperationRunViewer
    host_route: /admin/operations/{run}
    method: GET
    authorization:
      scope: workspace-canonical monitoring view
      unchanged_from_existing: true
    polling:
      source_of_truth: App\Support\OpsUx\RunDetailPolling::interval
      active_states:
        - queued
        - running
      terminal_states:
        - succeeded
        - partial
        - failed
      cadence:
        - age_lt_10s: 1s
        - age_lt_60s: 5s
        - steady_state: 10s
      suppression_conditions:
        - browser_tab_hidden
        - filament_actions_mounted
    response_shape:
      content_type: text/html
      behavior: renders run detail and emits polling only while the run remains active

  - name: tenant-review-pack-card
    kind: ui-component
    surface_class: App\Filament\Widgets\Tenant\TenantReviewPackCard
    host_route: intentionally reusable tenant-scoped embedded widget surfaces (component-scoped; no standalone route is owned by the widget itself)
    method: GET
    authorization:
      scope: tenant-scoped review pack surface
      unchanged_from_existing: true
    polling:
      source_of_truth: latest ReviewPack status for current tenant
      active_states:
        - queued
        - generating
      terminal_states:
        - ready
        - failed
        - expired
      cadence:
        - steady_state: 10s
      suppression_conditions:
        - no_review_pack_exists
    response_shape:
      content_type: text/html
      behavior: renders widget state and emits polling only while review pack generation is active
