# Increase the cumulative Scenario evidence handoff to 256 KiB

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "diagnostic-handoff-256kib-2026-09-08",
  "problems": [
    {
      "problemId": "cumulative-handoff-128kib-observation-loss",
      "summary": "The cumulative 128 KiB handoff dropped earlier metric observations after a Slow Query refinement on TCID-13139.",
      "status": "candidate",
      "applicability": "Scenario evidence handoffs larger than 128 KiB and no larger than 256 KiB of UTF-8 JSON.",
      "issueKeys": ["TCID-13139"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/TCID-13139#problem:cumulative-handoff-128kib-observation-loss"],
      "signalTextIncludesAny": ["cumulative-handoff-128kib-observation-loss"],
      "observedThrough": "2026-09-08",
      "effectiveAt": null,
      "verifiedAt": null,
      "attemptedAction": "Increase only the cumulative handoff byte limit from 131072 to 262144. Typecheck and full tests passed. Offline rematerialization of the frozen TCID-13139 Provider results retained all 12 observations at 146534 bytes, versus the archived 7 observations. Not deployed; no model execution or replay performed.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/TCID-13139"
    }
  ]
}
-->

Owner: runner-owned cumulative evidence handoff. Source: operator request to
raise this limit to 256 KiB and leave other behavior unchanged.
Base: `7972fcfa851612d76c2ed693add2aec34d2a3713` (fresh `origin/main`).

Only `maximumDiagnosticChildHandoffBytes` changes, from 131,072 to 262,144
UTF-8 bytes. The existing 4,000-character generic fact projection, 65,536-unit
single-fact limit, Provider selection and compaction, query counts, sessions,
models, timeouts, and optimizer behavior remain unchanged. Oversized handoffs
still use the existing whole-observation removal and omission reporting.

The source case is TCID-13139, replay
`e4322416-536b-44ea-ba46-f7e9870b89e8`, workload-hotspot round 2. Its archived
handoff reports 7/12 retained observations, including the loss of the initial
CPU, QPS, and P99 observations. Offline checks may rematerialize the same
persisted Provider results; they do not rerun a model or query a Provider.

## Source verification

- `npm run typecheck` passed.
- `npm test`: 1,209 passed, 2 skipped, 0 failed; isolated-runner script tests
  additionally passed 6/6. These are fixture tests, not a replay or real LLM run.
- The budget regression preserves a handoff between 128 and 256 KiB unchanged
  and still removes whole observations above 256 KiB. The single-fact constant
  remains 65,536, and the generated Evidence prompt reports 262,144 bytes.
- Offline verification used the unchanged source run's two Evidence traces,
  the production Managed Provider materializer, and the unchanged production
  cumulative merge function. It reconstructed 12 observations at 146,534
  bytes, retaining CPU, QPS, and P99. The archived 128 KiB result held 7
  observations at 129,938 bytes. The existing 4,000-character projection still
  occurred, as expected; this change does not repair that independent limit.

The offline check temporarily exposed the private merge function only in
ignored build output, then removed that export. No production API, Provider
request, raw frozen artifact, model session, or replay input was changed.

This change is not deployed, and no new full replay or Jira/DB/Base publication
is authorized. The record remains `candidate` until runtime availability is
established; it does not mark the ticket fixed. A later authorized deployment
and isolated replay are needed to assess diagnostic quality and timing.
