# Diagnostic Human Review Without Analysis Short-Circuit

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "diagnostic-human-review-2026-07-22",
  "problems": [
    {
      "problemId": "risk-preflight-short-circuits-evidence-rich-diagnosis",
      "summary": "Textual risk preflight stops read-only diagnosis and requests evidence already present in the ticket.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29183", "APID-29203"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29183#problem:ai_gap:duplicate-evidence-request",
        "https://tidb.atlassian.net/browse/APID-29203#problem:ai_gap:risk-short-circuit"
      ],
      "signalTextIncludesAny": [
        "请先补充 explain analyze",
        "请先补充最小复现信息",
        "stopped before codex analysis",
        "已有日志仍未诊断"
      ],
      "observedThrough": "2026-07-22",
      "effectiveAt": "2026-07-22T16:40:30+08:00",
      "verifiedAt": "2026-07-22T16:49:38+08:00",
      "attemptedAction": "Reserve diagnostic preflight for unavailable required providers, continue read-only analysis for risky cases, and enforce human review after diagnosis from scenario classification.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29203?focusedCommentId=23247770"
    }
  ]
}
-->

- Optimization ID: `diagnostic-human-review-2026-07-22`
- Owner: auto-oncall-services
- Source type: Jira answer-quality review
- Source reference: `APID-29183`, `APID-29203`

## Bounded problem

The deterministic diagnostic preflight treats broad textual risk matches as a
reason to stop before Codex analysis. It then derives customer evidence asks
from topic keywords without checking whether the ticket already contains those
artifacts. This turns evidence-rich optimizer and BR cases into generic
clarification drafts.

Human review and read-only diagnosis are separate decisions. Risky cases must
still receive a bounded evidence-based internal analysis; the scenario safety
classification must prevent an automatic customer-visible conclusion.

## Status

- Implementation: merged in `tidbcloud/aisupport#452` and deployed to staging
  as image `1c74083c3cd53a991ff74e082ed500b22fa91d38`.
- Effective status: `optimized_verified` after both evidence cases completed a
  deployed `mode=write` replay and their existing Jira internal comments were
  verified by comment ID.

## Verification evidence

- Pre-change run DB `60054` for `APID-29183` stopped before Codex and requested
  plan/schema/version evidence already represented by the replay input.
- Pre-change run DB `60044` for `APID-29203` stopped before Codex and requested
  a minimal reproduction despite complete BR `503 SlowDown` logs.
- Contract and full-suite validation passed: 397/397 tests.
- Post-change read replay `6d602d8c-0bc6-4814-8474-72f750ec92bd` for
  `APID-29183` used the supplied plan, requested no additional context, and was
  judged `ai_better`.
- Post-change read replay `c7110468-818e-4c79-b915-6523324c2400` for
  `APID-29203` diagnosed repeated S3 `503 SlowDown`, requested no additional
  context, and retained `human_required` because the ticket exposed AWS
  credentials.
- Deployed write run `35e99b56-6283-4b1a-a28e-7121d05d8e75` updated the
  existing `APID-29183` internal comment `23251200`. Direct Jira readback
  confirmed the draft used the supplied plan to diagnose the 8,271,608-row
  table scan and did not request the supplied SQL, DDL, version, or plan again.
- Deployed write run `ffea5b52-d330-4462-8a7c-18e2c3256edd` updated the
  existing `APID-29203` internal comment `23247770`. Direct Jira readback
  confirmed the draft diagnosed S3 `503 SlowDown`, requested no more logs, did
  not echo credential values, and retained human review for the exposed secret.

## Unresolved gaps

- None for this bounded problem. Newer evidence reproducing a duplicate request
  or a pre-analysis risk short-circuit remains eligible as a regression.

## Next validation action

Monitor later evidence-rich risk cases for regressions at the same problem
signal granularity.
