# Unified OP Support Gate

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "unified-op-support-gate-2026-08-20",
  "problems": [
    {
      "problemId": "disabled-op-provider-reported-as-scenario-uncovered",
      "summary": "APID-29375 was routed to Wetech while Wetech OP support was disabled, but the persisted Gate omitted op_unsupported and the Feishu notification incorrectly reported the case as scenario uncovered.",
      "status": "optimized_verified",
      "applicability": "Provider-backed OP tickets whose Account Alias is unknown or whose recognized Wetech or Manus Provider is disabled by its current runtime switch.",
      "issueKeys": ["APID-29375"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29375#problem:disabled-op-provider-reported-as-scenario-uncovered"
      ],
      "signalTextIncludesAny": [
        "gate:wetech_op_disabled",
        "gate:manus_op_disabled",
        "op_unsupported",
        "场景未覆盖"
      ],
      "observedThrough": "2026-08-20",
      "effectiveAt": "2026-08-20T02:44:24Z",
      "verifiedAt": "2026-08-20T02:47:01Z",
      "attemptedAction": "Unify unknown OP aliases and disabled Wetech or Manus routes under deterministic op_unsupported normalization while retaining independent Provider configuration switches.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29375"
    }
  ]
}
-->

- Optimization ID: `unified-op-support-gate-2026-08-20`
- Owner: deterministic Scenario and Provider normalization
- Source reference: APID-29375, Job 150490
- Implementation status: deployed to staging
- Effective status: optimized_verified

## Bounded problem

Job 150490 classified APID-29375 as `cluster_runtime_issue` with
`evidenceProvider=wetech`, while `wetechOpEnabled=false`. Auto Coverage stopped
the job with `gate:wetech_op_disabled`, but `riskFlags=[]`; downstream flow
classification therefore fell back to `场景未覆盖` even though that scenario was
enabled.

## Intended contract

Wetech and Manus keep independent configuration switches. OP Support admission
has one canonical unsupported outcome: an unknown Account Alias or a recognized
Provider whose switch is disabled becomes `human_required`, selects no evidence
Provider, and carries `op_unsupported`. Recognized Wetech and Manus routes avoid
that flag only while their respective switches are enabled.

New Gate results do not emit `gate:wetech_op_disabled` or
`gate:manus_op_disabled`. Historical or externally supplied workspaces remain
fail-closed at the Provider-access boundary and use the same
`op_unsupported` reason.

## Verification status

The full source suite passed with 925 tests and no failures. Source PR
`tidbcloud/aisupport#1019` and app-delivery PR
`tidbcloud/app-delivery#77727` merged. Staging Deployment generation 474
reached 1/1 updated, ready, and available replicas on image
`0f07f61ebc9269b06f2d46bd46f2a1e0d6808d98`; the new Pod became Ready at
`2026-08-20T02:44:24Z` with zero restarts, and both `/healthz` and `/readyz`
returned `status=ok`.

The first generic Gate-only recalculation could not serve as historical proof:
Job 150490 has no run manifest, so the CLI consumed later Jira context and
freshly classified the ticket as `non_target_admin_or_noise`. That result was
not retained as verification. The same Gate row was recovered from the frozen
original Job classification fields observed before rollout:
`cluster_runtime_issue`, `evidence_assisted`, `evidenceProvider=wetech`,
`lookupKeysPresent=[account_alias, cluster_alias]`, and no original risk flag.
The deployed deterministic policy then produced `human_required`,
`evidenceProvider=none`, `riskFlags=[op_unsupported]`, and only the canonical
scenario and resolution signals. Readback of Gate row 236560 at
`2026-08-20T02:47:01Z` confirmed those fields. The deployed flow classifier
returned `不支持的 OP 账号`, and the bounded Ticket Base sync returned
`updated`. No analysis run or Jira comment was created.

## Unresolved gaps

- The generic Gate-only CLI needs a separate replay-mechanics correction so an
  owner Job without a run manifest uses its historical cutoff instead of later
  Jira comments. This did not change the verified deterministic OP Support
  result above.

## Next validation action

Add and verify a historical-cutoff fallback for Gate-only recalculation of an
owner Job without a run manifest. Keep that replay-only work separate from this
verified OP Support optimization.
