# Historical From-Time Window

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "historical-from-time-window-2026-08-18",
  "problems": [
    {
      "problemId": "historical-incident-start-centered-before-event",
      "summary": "The Scenario Router treated wording that an incident started from a clock time as a point sample centered around that time, excluding the later portion where the reported bad plan and workload concentration occurred.",
      "status": "optimized_verified",
      "applicability": "Historical replays whose frozen ticket states that an incident started or continued from one explicit local clock time without an end time.",
      "issueKeys": ["TCID-12986"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/TCID-12986#problem:historical-from-time-window-centered"],
      "signalTextIncludesAny": ["from 17:45", "17:45から", "route_absolute", "ten-minute discovery interval centered"],
      "observedThrough": "2026-08-18",
      "effectiveAt": "2026-08-18T17:21:21.557Z",
      "verifiedAt": "2026-08-18T17:21:21.557Z",
      "attemptedAction": "Teach the Scenario Router to distinguish a point time from from/since/onward/から/起/以后/之后 wording and use a bounded fifteen-minute interval beginning at the stated incident start while preserving cutoff and timezone boundaries.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/TCID-12986?focusedCommentId=23357171"
    }
  ]
}
-->

- Owner: Scenario Router
- Source: TCID-12986 replay `b403a792-e319-42a2-b5ca-6bc147c0d1f4`
- Implementation status: deployed to staging
- Effectiveness status: optimized_verified

## Bounded problem

The frozen Japanese ticket says the CPU rise was observed `17:45から` (from
17:45). The Router selected 17:40–17:50 as if 17:45 were an isolated point.
That window returned the target SQL with plan `2d7c47`, but excluded the later
`1dd136` executions used in the human attribution over 17:45–18:00.

## Candidate change

Keep the existing ten-minute centered default for an isolated point time. When
the wording explicitly means from, since, or onward, instead use a bounded
fifteen-minute interval starting at that time. Preserve the replay cutoff's
timezone and never cross the immutable cutoff.

## Verification evidence

The route-prompt contract test verifies that this start-time distinction and
the Japanese `から` marker are present. The full TypeScript suite passed
903/903 tests on 2026-08-18.

The later staging `mode=write` replay
`b975f4a1-22a3-4cb6-8069-87779f626a02` used the bounded 17:45–18:00 incident
window on the frozen TCID-12986 ticket. Slow Query and instance-scoped TopSQL
both completed over that window, retaining the later bad-plan and TiKV-13
workload evidence. Evidence acquisition completed with all 41 Clinic query
events successful and `failureCodes=[]`. The final paired response preserved
the 17:45–18:00 scope and updated Jira internal comment `23357171`; readback
confirmed the same comment ID and `public=false`.

## Unresolved gaps

The bounded window does not itself establish which SQL explains the CPU delta;
that quantitative attribution remains a separate Scenario Diagnostic Agent
problem.

## Next validation action

Monitor later historical tickets whose start-time interval would cross the
immutable replay cutoff and confirm the runner keeps the route cutoff-bounded.
