# Replay Classification Cutoff

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "replay-classification-cutoff-2026-08-13",
  "problems": [
    {
      "problemId": "historical-replay-policy-reads-future-comments",
      "summary": "Historical replay sends cutoff-bounded comments to the Scenario Classifier but lets deterministic classification policy reread the ticket's complete future comment timeline and override the frozen classification.",
      "status": "optimized_verified",
      "applicability": "Historical read or write replay and recalculated Auto Coverage gates when deterministic scenario policy must use the same visible-comment cutoff as the Scenario Classifier.",
      "issueKeys": ["APID-29274"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29274#problem:historical-replay-policy-reads-future-comments"
      ],
      "signalTextIncludesAny": [
        "future comment overrides historical scenario classification",
        "post-cutoff unsupported setting changes duration replay to ddl",
        "classifier sees frozen comments but deterministic policy sees full timeline"
      ],
      "observedThrough": "2026-08-13",
      "effectiveAt": "2026-08-13T14:53:00Z",
      "verifiedAt": "2026-08-13T15:16:00Z",
      "attemptedAction": "Pass the same cutoff-bounded visible comment set to deterministic Auto Coverage policy in manual replay and Gate evaluation so later comments cannot change the historical scenario.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/APID-29274?focusedCommentId=23351216"
    }
  ]
}
-->

- Optimization ID: `replay-classification-cutoff-2026-08-13`
- Owner: auto-oncall-services scenario classification boundary
- Source reference: `APID-29274` frozen historical replay
- Implementation status: deployed to staging in image `917145b45f408a2a89a1c4c5ac301eb9e0d785df`
- Effective status: `optimized_verified`

## Bounded problem

The current staging `mode=read` replay used cutoff
`2026-07-30T10:26:28+0800` and correctly excluded the Auto-oncall comment and
all later replies from the classifier input. The classifier identified an
overall Duration investigation for Wetech, but deterministic policy then read
the complete 69-comment ticket timeline. A later 2026-08-03 comment about an
unsupported parameter matched the provider-free setting rule, changing the
historical result to `ddl_schema_change_advice / human_required / none`.

That stopped before `query-latency`, `workload-hotspot`, or any Wetech query.
It is an input/cutoff contract defect, not a Provider planning, execution,
empty-result, handoff, or diagnosis failure.

## Candidate change

- Apply deterministic replay policy to the same visible comments supplied to
  the Scenario Classifier.
- Preserve live behavior by using the full canonical live timeline when no
  narrower visible-comment set is supplied.
- Cover both the manual replay path and Auto Coverage gate evaluation with a
  post-cutoff unsupported-setting regression.

## Verification evidence

Current staging baseline run `f4aa82bf-990b-4929-bc18-163d66a436c2` returned
HTTP 200 but selected `ddl_schema_change_advice`, Provider `none`, and no
diagnostic scenarios. Its input manifest excluded comments `23351216` and
`23365332`; read-only Jira inspection confirmed that future comment `23406005`
was the unrelated unsupported-parameter match.

Post-deployment read run `f903335a-315b-40c6-b043-37200fe8dcd0` and write run
`5b552e11-7ad7-4ce7-949e-8e6b5f4d6431` retained cutoff
`2026-07-30T10:26:28+0800`, included only comments `23351087`, `23351093`, and
`23351097`, and excluded internal comment `23351216` plus all later comments.
Both runs reached `query-latency` and `workload-hotspot` with complete Wetech
acquisition. The write run persisted as DB run `150033` and refreshed the
existing private Jira comment `23351216`.

## Unresolved gaps

- The fixed cutoff protects historical replay fidelity; it does not by itself
  establish a specific SQL root cause or a 07/24 pre-release baseline.

## Next validation action

Keep future replay and Gate regressions aligned to the same visible-comment
owner. Apply query-tuning reasoning only when a concrete Digest or SQL plus
plan or scan evidence establishes the mechanism.
