# Wetech Target Gap Terminal Handoff

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "wetech-target-gap-terminal-handoff-2026-08-14",
  "problems": [
    {
      "problemId": "wetech-unresolved-target-escalates-to-service-error",
      "summary": "A valid Scenario Router result with no exact Wetech target was thrown as a runner bootstrap error, retried three times, and reported as a service failure instead of completing one human-required ticket analysis.",
      "status": "optimized_unverified",
      "applicability": "Wetech OP diagnostics where the Scenario Router cannot resolve one exact canonical target from the frozen region-scoped inventory.",
      "issueKeys": ["APID-29343"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29343#problem:wetech-unresolved-target-service-error"
      ],
      "signalTextIncludesAny": [
        "diagnostic_wetech_target_missing",
        "analysis execution failed after 3 retries",
        "target identity is the sole blocker"
      ],
      "observedThrough": "2026-08-14",
      "effectiveAt": "2026-08-14T02:08:46Z",
      "verifiedAt": null,
      "attemptedAction": "Short-circuit unresolved Wetech targets before bootstrap, materialize bounded target-resolution packets, require a human-owned Router decision with no customer requested context, and continue normal Final Response and Jira internal delivery without worker retry.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/903"
    }
  ]
}
-->

- Owner: Auto-oncall diagnostic runner and Scenario Router lifecycle
- Source: APID-29343, Job 150117
- Bounded problem: unresolved Wetech target identity was incorrectly promoted
  from a ticket-level diagnostic gap to a retryable runner exception.
- Implementation status: deployed to staging and live-read verified.
- Effective status: optimized_unverified.

## Intended behavior

- Preserve `diagnostic_wetech_target_missing` as failed evidence acquisition.
- Do not start Wetech authentication, Evidence Agent planning, Provider
  execution, or Scenario Diagnostic Agent work without an exact target.
- Continue Router reconciliation and Final Response with a mandatory
  `human_required` decision and no customer-owned requested context.
- Complete the Job through the normal Jira internal-comment path without a
  worker retry or service-error notification.

## Verification status

Local verification passed at `2026-08-14T01:36:09Z`:

- `npm run build`
- the focused unresolved-target runner test
- all runner and diagnostic-scenario tests (143 tests)
- the complete repository test suite (818 tests)

Staging deployment and live read-only verification completed on 2026-08-14:

- aisupport PR [#903](https://github.com/tidbcloud/aisupport/pull/903)
  merged as `1c36f0277e3f896c896da46817b5f9b069c5eafb`.
- app-delivery PR
  [#77271](https://github.com/tidbcloud/app-delivery/pull/77271) registered that
  staging image. The live Pod subsequently converged to newer main image
  `0f85130117060fb83421029ecb7710c17de22643`, which contains the #903 merge,
  and was Ready with zero restarts.
- Live `mode=read` run `eb91ffed-1aae-45f8-a7b3-4aebc5e6e4ed` used a synthetic
  Wetech ticket with an intentionally unmapped cluster alias. It returned
  `decision=human_required`, `requestedContext=[]`, and
  `clarificationSimulation.required=false`; response generation completed and
  evidence acquisition retained `diagnostic_wetech_target_missing`.
- The live trace recorded auth bootstrap as `not_run`; both selected scenarios
  became zero-duration bounded failures. Its only calls were Scenario Router
  selection, Router reconciliation, and Final Response. No Evidence Agent,
  Provider Executor, or Scenario Diagnostic Agent artifact was created.
- The request was read-only: DB, Jira, evaluation persistence, and Feishu
  publication all remained `not_requested`.

This proves the deployed runner returns a terminal handoff instead of throwing.
The status remains `optimized_unverified` because the read-only synthetic run
did not exercise a real worker Job and `public=false` Jira internal-comment
write.

## Next validation action

On the next real unresolved-target ticket, verify one worker attempt reaches
`succeeded`, failed evidence acquisition retains the target-missing code, and
the stable Jira delivery is exactly one `public=false` internal handoff without
a service-error notification.
