# L1 Clarification And Dual Message Completion

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "l1-clarification-dual-message-2026-08-12",
  "problems": [
    {
      "problemId": "final-customer-clarification-not-routed-to-l1",
      "summary": "A final answer could ask the customer for required context while remaining internal_only, and the stable internal Jira comment could omit either the suggested customer wording or the internal handoff.",
      "status": "optimized_verified",
      "issueKeys": ["APID-29325", "ST-2881"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29325#problem:final-customer-clarification-not-routed-to-l1",
        "https://tidb.atlassian.net/browse/ST-2881#problem:final-customer-clarification-not-routed-to-l1"
      ],
      "signalTextIncludesAny": [
        "clarification requested but decision internal_only",
        "requestedContext without human_required",
        "internal comment omits customer or internal message"
      ],
      "observedThrough": "2026-08-12",
      "effectiveAt": "2026-08-12T05:59:00Z",
      "verifiedAt": "2026-08-12T06:36:40Z",
      "attemptedAction": "Make final clarification represented by requestedContext or clarificationSimulation deterministically human_required through the L1 fallback, keep resolved classification-time gaps automatic, and preserve paired customer and internal sections in the stable Jira internal delivery for the verified cases.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/blob/main/auto-oncall-services/docs/opts/2026-08-12-l1-clarification-dual-message.md"
    }
  ]
}
-->

- Optimization ID: `l1-clarification-dual-message-2026-08-12`
- Owner: typed final-clarification fallback and paired Jira internal delivery
- Source references: `APID-29325`, `ST-2881`
- Implementation status: deployed to staging
- Effective status: `optimized_verified`

## Bounded problem

The classifier may correctly identify missing customer-owned context, but final
completion could still return `internal_only` while asking the customer a
question. Internal delivery could also preserve only one audience's message.

## Contract

- Non-empty final `requestedContext` or
  `clarificationSimulation.required=true` always forces
  `decision=human_required`; L1 owns the customer interaction.
- A classification-time missing key that is resolved by authorized evidence and
  no longer produces a customer question does not force human takeover.
- Final completion always returns `customerReplyMarkdown` as the customer
  message and `internalHandoffMarkdown` as the internal message. When no public
  message is written, the stable `public=false` Jira comment preserves both.

## Verification

This verification is case-specific to the typed clarification decision and the
paired Jira internal delivery described above. It does not prove that answer
identity, historical persistence, replay, evaluation, or optimizer consumers
preserve the pair end to end; the later lifecycle review is tracked separately
by `2026-08-12-dual-message-lifecycle-contract.md`.

- Source PR [#816](https://github.com/tidbcloud/aisupport/pull/816) and
  app-delivery PRs
  [#76958](https://github.com/tidbcloud/app-delivery/pull/76958) and
  [#76959](https://github.com/tidbcloud/app-delivery/pull/76959) were merged.
  The optimizer is running image `5152c959`; the runtime is Ready on later image
  `2de08589`, which contains `5152c959`.
- `APID-29325` replay `1cc63e28-d630-40d8-ac49-cb8523811dd9` resolved the
  classifier-time target gap internally and correctly remained `internal_only`
  with no final customer question. Write run
  `c800576b-0cf4-4ce0-bde0-58221539d248` updated internal comment `23506981`.
- `ST-2881` replay `2e7550e1-64af-4fdf-92ca-e196b3f43b26` emitted an actual
  customer question and correctly became `human_required`. Write run
  `282ed7a1-5914-42ab-b102-759145768008` was recovered onto the original
  internal comment `23502445`; the transient duplicate `23535706` was removed
  and the stable target restored.
- `APID-29304` control replay `f3691fc8-5d47-4486-ba0b-32736e59f9e2` emitted no
  customer question and correctly remained `internal_only`.
- Both read-back Jira comments are `public=false` and contain
  `【建议对客回复】` plus `【内部交接】`. The complete TypeScript suite passed 748
  tests; optimizer `go test ./...` and `go vet ./...` passed.

An `APID-29333` attempt overlapped a later staging rollout and was interrupted;
it is not counted as one of the three completed conclusion checks.

## Next validation action

Monitor subsequent clarification cases for regressions. Re-run `APID-29333`
only if case-specific confirmation is needed; its interrupted attempt provides
no pass or fail evidence.
