# Managed Provider mixed-route accounting

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "managed-provider-mixed-route-accounting-2026-09-07",
  "problems": [
    {
      "problemId": "managed-provider-supplied-scenario-counted-in-completion",
      "summary": "Agent9 Managed Provider completion counted a routed supplied-evidence scenario that intentionally had no Managed Provider call, degrading otherwise complete Provider acquisition.",
      "status": "candidate",
      "applicability": "Agent9-backed evidence-assisted analysis with a mixed route where at least one scenario uses supplied evidence and other scenarios execute the selected Managed Provider.",
      "issueKeys": ["TCID-13132"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/TCID-13132#problem:current-agent9-managed-provider-mixed-route-accounting"],
      "signalTextIncludesAny": ["providerCapabilityVerified=false", "evidenceAcquisition=degraded", "failureCodes=[]"],
      "observedThrough": "2026-09-07",
      "effectiveAt": null,
      "verifiedAt": null,
      "attemptedAction": "Aggregate Agent9 Managed Provider completion only across routed scenarios that select Provider evidence while preserving their complete ordered query-attempt history.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/TCID-13132"
    }
  ]
}
-->

- Owner: auto-oncall-services runner execution-state materialization
- Source reference: TCID-13132 selected single-ticket finding
- Implementation status: candidate
- Effective status: candidate

## Bounded problem

A mixed diagnostic route can use ticket-supplied evidence for one scenario and
the selected Managed Provider for other scenarios. The supplied-evidence
scenario intentionally has no Managed Provider artifact, but the runner counted
it in the Provider completion denominator. Fully successful Provider scenarios
were therefore reported as degraded with no failure code.

## Change

The runner computes Managed Provider completion from only the scenarios routed
to Provider evidence. Supplied-evidence scenarios do not lower Provider
capability, while a Provider-routed scenario with a missing or failed call and
its attempt history keep the existing status semantics.

## Verification

A deterministic runner regression routes one supplied-evidence scenario and
two Provider scenarios. Both Provider calls must yield complete acquisition,
verified capability, no failure code, and two preserved query attempts.

## Unresolved gaps

The independent Scenario Diagnostic finalization timeout observed on the same
ticket is outside this repair and remains unresolved.

## Next validation action

After deployment, replay TCID-13132 in read mode and confirm the mixed route
reports complete Provider acquisition while retaining both Provider scenarios'
ordered query attempts.
