# APAC Public Cohort

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "apac-public-cohort-2026-08-26",
  "problems": [
    {
      "problemId": "apac-project-and-cloud-region-not-admitted",
      "summary": "The customer-publication cohort admitted only explicit Account Aliases and org IDs, so APAC OP and Cloud tickets were not covered by their canonical Jira project and region signals.",
      "status": "optimized_verified",
      "applicability": "Bot-assignment tickets that pass every existing publication gate and either belong to APID or have a typed Cloud org ID plus TiDB Cloud Org Region APAC.",
      "issueKeys": [
        "APID-29398",
        "ST-2915",
        "ST-2841",
        "ST-2836",
        "TCID-13085"
      ],
      "sourceRefs": [],
      "signalTextIncludesAny": [
        "customer_cohort_not_enabled",
        "project apid",
        "tidb cloud org region apac"
      ],
      "observedThrough": "2026-08-26",
      "effectiveAt": "2026-08-26T15:42:25+08:00",
      "verifiedAt": "2026-08-26T15:47:14+08:00",
      "attemptedAction": "Read the typed Jira region field and added configurable APID project and APAC Cloud-region cohort checks while preserving every existing scenario, completion, risk, validator, idempotency, and delivery boundary.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/1104"
    }
  ]
}
-->

- Optimization ID: `apac-public-cohort-2026-08-26`
- Owner: auto-oncall-services customer publication cohort
- Source reference: user-approved APAC cohort expansion on 2026-08-26
- Implementation status: merged in source PR
  [#1104](https://github.com/tidbcloud/aisupport/pull/1104), synchronized
  through app-delivery PRs
  [#78395](https://github.com/tidbcloud/app-delivery/pull/78395),
  [#78396](https://github.com/tidbcloud/app-delivery/pull/78396), and
  [#78397](https://github.com/tidbcloud/app-delivery/pull/78397), then deployed
  to staging
- Effective status: `optimized_verified`

## Bounded problem

The Public Gate cohort currently admits configured Account Aliases and exact
TiDB Cloud org IDs. It cannot admit all APAC OP tickets through the canonical
`APID` project boundary or all APAC Cloud tickets through Jira's
`TiDB Cloud Org Region` field.

The sampled Jira boundary was:

- APAC OP is identified by `projectKey=APID`;
- APAC Cloud requires a non-empty typed `orgId` and exact region `APAC`;
- region `RDG`, another region, or an empty region does not enter through the
  APAC region rule.

This change affects only cohort admission. It does not enable customer replies,
add scenarios, bypass Bot Assignment, weaken evidence completion, publish a
clarification, override hard risks, skip the independent validator, or change
Jira delivery idempotency and preflight.

## Implemented change

- Read Jira `customfield_12841` as the typed
  `SupportCase.tidbCloudOrgRegion` field.
- Add configurable eligible Jira project keys and Cloud org regions to the
  existing cohort union.
- Configure staging templates with `APID` and `APAC` while keeping the customer
  reply feature disabled.
- Preserve the existing Account Alias and exact org-ID cohorts.

## Verification evidence

- Typecheck, 79 focused tests, and the complete 978-test suite passed; both
  staging overlays rendered successfully.
- The Jira field was read back directly after it was added to the ST view
  screen: `ST-2915=APAC`, `ST-2841=RDG`, and `ST-2836` has an explicit empty
  value.
- Staging Pod `auto-oncall-services-agent9-f5dcff59b-pq24d` became Ready with
  image `7d427b2b57b5cf67e2002b27c5e8bdfd62b6e846`, zero restarts, and both health
  endpoints returning HTTP 200.
- Live Pod environment readback showed project key `APID` and Cloud region
  `APAC`, while `AUTO_ONCALL_CUSTOMER_REPLY_ENABLED=false` remained unchanged.
- A no-write gate readback using the deployed code and live Jira admitted
  `APID-29398`, APAC Cloud cases `ST-2915` and `TCID-13085`, and rejected RDG
  case `ST-2841` plus empty-region case `ST-2836`.
- Post-rollout logs showed successful poll cycles, idle workers, and watchdog
  cycles with zero timeouts. The database had no queued, running, or
  retryable-failed jobs. The initial poll cursor correctly remained unchanged
  for a zero-issue cycle because that cursor advances only from a processed
  issue's `created` timestamp.

## Unresolved gaps

- No real customer-visible Jira write is claimed; the feature remains disabled.
- Enabling public delivery remains a separate rollout decision and must retain
  all existing publication gates and readback requirements.

## Next validation action

When customer replies are explicitly enabled in a later rollout, verify the
first eligible APID or APAC Cloud delivery by its Jira public comment ID and
the stored idempotency mapping without weakening any existing gate.
