# Scenario Digest Context Projection

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "scenario-digest-context-projection-2026-08-18",
  "problems": [
    {
      "problemId": "scenario-diagnostic-repeats-full-supplied-digest",
      "summary": "A full SQL Digest correctly supplied to Wetech was also copied into the persistent Scenario Diagnostic Agent context; when the Agent repeated it in its causal brief, the disclosure parser rejected the entire otherwise usable scenario result.",
      "status": "optimized_verified",
      "applicability": "Provider-backed diagnostic scenarios whose frozen ticket or route fields contain an exact 64-hex SQL Digest.",
      "issueKeys": ["APID-29340"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29340#problem:scenario-full-digest-rejected"],
      "signalTextIncludesAny": ["diagnostic_scenarioevidence_sensitive_value", "full supplied Digest in Scenario Diagnostic context", "valid scenario result discarded for opaque digest"],
      "observedThrough": "2026-08-19",
      "effectiveAt": "2026-08-19T00:57:14+08:00",
      "verifiedAt": "2026-08-19T10:24:47+08:00",
      "attemptedAction": "Project complete SQL Digests to a bounded prefix only in Scenario Diagnostic Agent prompts while preserving the exact runner-owned value for Evidence Agent planning and Provider Executor binding.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29340?focusedCommentId=23548869"
    }
  ]
}
-->

- Optimization ID: `scenario-digest-context-projection-2026-08-18`
- Owner: runner-owned Scenario Diagnostic Agent input projection
- Source reference: `APID-29340`
- Implementation status: deployed in image `00add7fc3ad53efc10d99e6fa9e687b1fae3197c`
- Effective status: `optimized_verified`

## Bounded problem

The exact Digest added to runner-owned customer evidence fixed Provider
selection, but the same immutable frozen context was also serialized into the
persistent Scenario Diagnostic Agent's initial prompt. That Agent needs the
identity fact and compact evidence, not the opaque acquisition key. Repeating
the full value into one textual decision field caused the packet disclosure
boundary to reject the whole scenario and discard successful Wetech evidence.

## Change

- Replace complete 64-hex values with a 12-character prefix only when
  serializing Scenario Diagnostic Agent input.
- Apply the same projection to the inline route reason and later finalization
  context because the thread persists across both turns.
- Keep the exact Digest unchanged in the runner-owned Provider context and
  Evidence Agent prompt so deterministic Slow Query binding remains exact.
- Keep full-Digest rejection in scenario decision parsing; do not normalize an
  already generated decision or weaken the disclosure boundary.

## Verification evidence

Read replay `ee2e4329-e044-4ea1-bd7a-9de9c8553337` and write replay
`e3615672-9bb2-4245-9f6c-9ad2f5e565c0` completed all three scenario diagnoses
without `diagnostic_scenarioevidence_sensitive_value`, while exact-Digest
Wetech operations still completed. The final answer used the retained execution
facts and preserved the `BATCH ON` conclusion without exposing the full Digest.

The write replay updated existing Jira internal comment `23548869`; direct
readback confirmed the expected text and `public=false`. Database run `150100`,
evaluation, and Feishu Base publication all succeeded.

## Unresolved gaps

Provider retention or plan decoding may still bound exact execution diagnosis.
Those are evidence limitations and must not be conflated with this input
projection failure.

This bounded context-projection problem is verified. Provider retention and
alert attribution remain separate evidence questions.
