# Historical Ticket Incident Time

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "historical-ticket-incident-time-2026-08-18",
  "problems": [
    {
      "problemId": "historical-replay-explicit-clock-overridden-by-reply-lookback",
      "summary": "Historical replay replaced an explicit ticket incident clock with the one hour before the later human reply, causing exact-Digest Slow Query and plan acquisition to query the wrong interval.",
      "status": "optimized_verified",
      "applicability": "Historical diagnostic replays whose frozen ticket supplies an incident date, clock time, or bounded interval before the replay cutoff.",
      "issueKeys": ["APID-29340"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29340#problem:explicit-incident-clock-overridden-by-reply-lookback"],
      "signalTextIncludesAny": ["explicit incident clock", "reply cutoff lookback", "wrong historical provider window"],
      "observedThrough": "2026-08-19",
      "effectiveAt": "2026-08-19T00:57:14+08:00",
      "verifiedAt": "2026-08-19T10:24:47+08:00",
      "attemptedAction": "Let the Scenario Router resolve frozen ticket incident times using the replay cutoff timezone context, while the runner canonicalizes and cutoff-bounds the selected absolute range and retains the reply lookback only as a no-time fallback.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29340?focusedCommentId=23548869"
    }
  ]
}
-->

- Optimization ID: `historical-ticket-incident-time-2026-08-18`
- Owner: Scenario Router assignment with runner-owned absolute-window validation
- Source reference: `APID-29340`
- Implementation status: deployed in image `00add7fc3ad53efc10d99e6fa9e687b1fae3197c`
- Effective status: `optimized_verified`

## Bounded problem

The frozen ticket says the incident occurred at `04:40`, and the historical
replay cutoff is `2026-08-13T13:04:22+08:00`. The previous route contract
discarded the Router's time interpretation and always queried the one hour
before that later reply. Exact-Digest acquisition consequently searched around
`04:40 UTC` in the wrong calendar/offset context and returned empty results.

## Change

- Supply the immutable replay cutoff and its explicit UTC offset as Router
  context.
- Let the Scenario Router interpret an explicit frozen-ticket date, clock, or
  interval. A clock-only value uses the cutoff's local calendar and offset and
  resolves to the latest occurrence no later than the cutoff.
- Canonicalize that selection to a finite UTC provider range, reject future,
  timezone-less, or over-24-hour route ranges, and preserve the existing
  one-hour cutoff lookback only when the ticket supplies no incident time.

For `APID-29340`, the expected narrow range is
`2026-08-13 04:35..04:45 +08:00`, equivalent to
`2026-08-12 20:35..20:45 UTC`.

## Verification evidence

Read replay `ee2e4329-e044-4ea1-bd7a-9de9c8553337` and write replay
`e3615672-9bb2-4245-9f6c-9ad2f5e565c0` both used the ticket incident window
`2026-08-13 04:35..04:45 +08:00`, not the one-hour lookback before the later
human reply. Exact-Digest Slow Query and aligned metric requests returned the
incident executions. Judge returned `ai_better` with no AI gaps.

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

The corrected range makes retained evidence discoverable but does not itself
prove a root cause. Empty retention or an incomplete causal chain must remain
an explicit evidence gap.

This bounded incident-window problem is verified. Retention and causal
attribution remain independent evidence questions.
