# Problem-level Focus optimization registry

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "problem-level-focus-registry-2026-07-20",
  "problems": [
    {
      "problemId": "focus-reselects-consumed-or-verified-problems",
      "summary": "Focus consumes report cases at ticket level and cannot distinguish verified problems from unrelated gaps or later regressions.",
      "status": "optimized_verified",
      "issueKeys": [],
      "sourceRefs": [],
      "signalTextIncludesAny": [],
      "observedThrough": "2026-07-20",
      "effectiveAt": "2026-07-20T19:38:00+08:00",
      "verifiedAt": "2026-07-20T19:38:00+08:00",
      "attemptedAction": "Create stable problem-signal refs, consume strict docs/opts metadata, and preserve unrelated or post-verification regression signals.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/388"
    }
  ]
}
-->

## Bounded problem

Recent Focus previously consumed a whole report case or Jira cutoff. A later
selector could therefore either repeat a problem already fixed outside Focus or
hide unrelated unresolved problems from the same ticket. The prose-only
`docs/opts/` handoff was not part of the runtime selection path.

## Implementation and effective status

- PR https://github.com/tidbcloud/aisupport/pull/388 introduced strict
  `auto-oncall-optimization-record-v1` metadata and bundled it into the runtime
  image.
- Target comparisons are split into stable problem-signal refs. A newly created
  Focus must cite exactly one problem ref per target; controls cite none.
- `optimized_verified` filters only a matching signal at or before
  `observedThrough`. Unrelated gaps remain, and later matching evidence is
  annotated as a regression.
- Implementation status: merged and deployed to staging as
  `ed081f2a42582af2a508226964b2bd84b1217d09`.

## Validation evidence

- Full repository test suite passed, 338/338, before submission; PR CI passed
  after rebasing the concurrent BR optimization record.
- Focused optimization-record and selection suites passed, 14/14.
- Staging Deployment and Recent Optimizer CronJob both use image
  `ed081f2a42582af2a508226964b2bd84b1217d09`.
- Runtime parser loaded four optimization documents and nine problem entries.
- A runtime signal check removed APID-29189's verified
  `process_keys/total_keys` gap while preserving the unrelated customer-wording
  gap from the same ticket and leaving the adjacent APID-2 gap untouched.
- The staging service was Ready `1/1`, health returned `ok`, startup/background
  logs had no failures, and DB readback found no `queued` or `running` jobs.

## Unresolved gaps and next action

- Legacy Focus Issues may still contain whole report-case refs; only newly
  generated Focus contracts use problem refs.
- Weekly optimization attribution remains ticket-level and does not yet consume
  mixed problem states from `docs/opts/`.
- Let the normal scheduled optimizer use the new selector. If a real
  post-verification regression appears, confirm it is retained and labeled as
  a regression rather than silently suppressed.
