# Cloud Clinic Primary Routing

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "cloud-clinic-primary-routing-2026-08-11",
  "problems": [
    {
      "problemId": "cloud-diagnostics-routed-through-investibook-before-clinic",
      "summary": "New Cloud performance diagnostics selected Investibook first even though Clinic is sufficient as the direct read-only Cloud diagnostic route.",
      "status": "optimized_unverified",
      "issueKeys": ["TCID-12986", "ST-2810"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/TCID-12986#problem:cloud-investibook-primary-routing",
        "https://tidb.atlassian.net/browse/ST-2810#problem:cloud-investibook-primary-routing"
      ],
      "signalTextIncludesAny": [
        "cloud performance routed to investibook",
        "investibook to clinic fallback",
        "cloud provider should be clinic"
      ],
      "observedThrough": "2026-08-11",
      "effectiveAt": "2026-08-11T11:34:04Z",
      "verifiedAt": null,
      "attemptedAction": "Route every newly classified Cloud diagnostic identified by orgId directly to Clinic and remove Investibook from the classifier output contract while retaining read compatibility for historical persisted runs.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/actions/runs/31486871861"
    }
  ]
}
-->

- Optimization ID: `cloud-clinic-primary-routing-2026-08-11`
- Owner: auto-oncall-services
- Source: user-reviewed TCID-12986 and ST-2810 replay evidence
- Implementation status: deployed to staging as `fc4bea6bcff111dad44b7b653c68bd6e17b7f86d`
- Applicability: newly generated Cloud diagnostic classifications identified by `orgId`, regardless of Jira project key

## Bounded problem

Cloud diagnostics selected Investibook first and reached Clinic only through a
runtime fallback. Clinic is sufficient for the supported Cloud read-only
diagnostic path, so the extra primary route adds a failure boundary without
adding required capability.

## Intended change

New Cloud diagnostics select Clinic directly in the classifier contract and
deterministic routing policy. Historical persisted Investibook payloads remain
readable, but no new classifier output or routing decision selects Investibook.

## Verification status

The complete rebased repository suite passes with 742 tests. A five-attempt local
TCID-12986 classifier run selected `sql_performance_tuning`,
`evidence_assisted`, Provider `clinic`, and `missingKeys=[]` in every attempt.

Source PR [#776](https://github.com/tidbcloud/aisupport/pull/776) merged as
`fc4bea6bcff111dad44b7b653c68bd6e17b7f86d`. Staging release
[31486871861](https://github.com/tidbcloud/aisupport/actions/runs/31486871861)
and app-delivery PR
[#76844](https://github.com/tidbcloud/app-delivery/pull/76844) completed. The
live Deployment used that exact image; its new Pod was Ready with zero restarts,
and `/healthz` and `/readyz` both returned HTTP 200.

Post-deployment `mode=read` replay evidence:

- TCID-12986 run `0f1508cd-45df-464c-8345-cc3ccb3ddba2` persisted
  `sql_performance_tuning`, `evidence_assisted`, Provider `clinic`, and
  `missingKeys=[]`; Clinic executed two evidence rounds before final synthesis.
- ST-2810 run `8a4404ee-1de0-4852-8200-42e90e01c5b7` persisted the same routing
  and empty missing-key result; Clinic executed one evidence round before final
  synthesis. Its separate `conflicting_cluster_ids` risk was preserved and the
  canonical typed target remained authoritative.

Both final answers were `human_required` because their Clinic evidence did not
establish enough record-level plan, scan, workload-identity, or causality
evidence. That is a downstream evidence-coverage result, not a regression to
classifier failure or Investibook routing. An earlier TCID-12986 read request,
run `9a610adc-0dac-4331-b2af-e6fa0e054ee4`, completed two Clinic batches but its
test client disconnected on a five-minute response-header timeout before final
synthesis; the completed run above used a longer client timeout.

A later staging release advanced the live image to
`d5b86d91700f9eaa523985ae830c427f106a2645`, which contains the original
`fc4bea6b` change plus the subsequent scenario split from PR #777. A fresh
current-runtime TCID-12986 replay, run
`740eed71-f525-433c-a402-5ce8628ee074`, again persisted
`sql_performance_tuning`, `evidence_assisted`, Provider `clinic`, and
`missingKeys=[]`. The newer runtime split execution into `query-latency` and
`workload-hotspot`; both used Clinic and completed final synthesis. Partial
Clinic HTTP 500/502 results kept the answer `human_required`, without reverting
to Investibook or classifier failure.

## Unresolved gaps

The bounded routing criterion passes on both cited cases, but their existing
Jira internal comments have not been refreshed. Under the publication contract,
the problem remains `optimized_unverified` until the applicable existing
internal comments are updated in place and read back as `public=false`.
The downstream Clinic evidence gaps remain separate candidate problems and do
not invalidate the routing result.

## Next validation action

After human review of the replay drafts, refresh each applicable existing Jira
internal comment through the authorized write path, verify the same comment ID
and `public=false`, then promote only this bounded routing problem to
`optimized_verified`.
