# Monitoring-semantics scoped publication

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "monitoring-semantics-scoped-publication-2026-08-11",
  "problems": [
    {
      "problemId": "metric-semantics-boundary-erases-independent-evidence",
      "summary": "One metric-semantics signal replaced independently validated Slow Query and workload observations with a case-wide generic checklist.",
      "status": "optimized_unverified",
      "issueKeys": ["APID-29296"],
      "sourceRefs": ["https://tidb.atlassian.net/browse/APID-29296#problem:metric-semantics-boundary-erases-independent-evidence"],
      "signalTextIncludesAny": ["metric_semantics_unverified", "当前监控值存在口径矛盾", "final answer lost admitted evidence"],
      "observedThrough": "2026-08-11",
      "effectiveAt": "2026-08-11T08:24:30Z",
      "verifiedAt": null,
      "attemptedAction": "Scope the metric-semantics boundary to claims that depend on the disputed metric, retain materialized-summary observations for synthesis, and carry independently validated scenario observations into the deterministic safe-publication fallback.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/tree/main/auto-oncall-services/docs/opts/2026-08-11-monitoring-semantics-scoped-publication.md"
    }
  ]
}
-->

- Optimization ID: `monitoring-semantics-scoped-publication-2026-08-11`
- Owner: auto-oncall-services
- Source: APID-29296 staging replays `fa3d1f59-d259-4e6c-a0cf-976c61c0ea76`
  and `08e4e184-2206-4644-b3e9-86f9b8305727`
- Implementation status: deployed to staging, case criterion not verified

## Bounded problem

The replay materialized the human-identified `ANALYZE TABLE` Slow Query with
its instance, duration, and peak memory. A separate TiKV-memory observation was
classified as `metric_semantics_unverified`. The resolver promoted that one
signal to a case-wide boundary, removed the packet observations before Final
Synthesis, and then replaced both publication surfaces with a fixed generic
monitoring-semantics checklist.

The safety boundary must reject causal use of the disputed metric. It must not
erase facts independently established by Slow Query, TopSQL, resource limits,
or another scenario.

## Attempted change

- Limit the synthesis instruction to the disputed metric and claims depending
  on that metric.
- Preserve Scenario Diagnostic Agent observations for materialized-summary
  signals; supplied-image text remains redacted.
- Keep deterministic fail-closed publication, but carry up to five independent
  validated observations from packets that do not contain untrusted supplied
  image values.

## Verification status

The targeted monitoring-semantics unit and runner regressions pass. The full
repository suite passes 734/734. Source PR `tidbcloud/aisupport#761` merged as
`a521e86e6e85788502630ca68cc813dea79038dd`; staging workflow
`31472625107` built descendant image
`200fa601c81c3d382e6cbbd7789424c1cdfe2efa`, and app-delivery PR `#76813`
merged as `1432fd416c07df56f510b37e0eeded5161e5fcef`. The live staging Pod became
Ready with zero restarts, and both `/healthz` and `/readyz` returned HTTP 200.

Read-only APID-29296 replay `08e4e184-2206-4644-b3e9-86f9b8305727`
completed with verified Wetech capability and no Jira, DB, evaluation, or
Feishu writes. The draft was no longer replaced by the generic
recording-rule/dashboard checklist. It retained the 524-second query-tail
observation, token/admission waiting, high TiKV RSS, bounded uncertainty, safe
concurrency mitigation, and tier-specific temporary scale-out ownership.

The replay did not meet the case criterion. Its first Slow Query request
returned Dashboard HTTP 400 `common.bad_request`, while both round-two Slow
Query and Statements plans used array-valued `fields` rejected by the runner
as `op_batch_parameter_invalid`. Consequently this run did not materialize the
previous replay's `ANALYZE TABLE` row, and no `metric_semantics_unverified`
signal reached publication. The replay therefore shows a better final answer,
but it does not directly exercise or verify independent-fact preservation
under the typed metric-semantics boundary.

## Unresolved gaps

- The post-deployment replay did not reproduce the successful Slow Query
  evidence from the pre-change replay because Dashboard returned HTTP 400.
- Round-two `fields` normalization remains a separate provider-plan defect.
- The APID-29296 Scenario Diagnostic Agent previously described the exact Slow
  Query as unresolved workload identity. This record preserves admitted facts
  through publication but does not independently change workload-attribution
  semantics.
- The existing Jira internal comment was not refreshed.

## Next validation action

First repair or successfully retry the bounded Slow Query request and normalize
round-two `fields` into the provider's accepted string form. Replay APID-29296
again with the historical cutoff and verify that the draft retains the
`ANALYZE TABLE` observation while keeping only the disputed TiKV metric behind
recording-rule, query-semantics, and display-chain validation. Refresh the
existing Jira internal comment only after that case-specific criterion passes.
