# Primary Analysis And Reply-format Ownership Boundary

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "primary-analysis-reply-format-boundary-2026-08-14",
  "problems": [
    {
      "problemId": "analysis-semantics-owned-by-response-format",
      "summary": "The response-format prompt contains product, evidence, diagnostic, risk, and decision semantics even though it is a presentation input and downstream wording must not own those decisions.",
      "status": "optimized_unverified",
      "applicability": "Primary Analysis direct answers, direct-artifact answers, and Scenario Router responses whose presentation contract must preserve but not originate semantic decisions.",
      "issueKeys": ["APID-29333", "APID-29338", "ST-2891", "APID-29340", "APID-29343"],
      "sourceRefs": [
        "https://tidb.atlassian.net/browse/APID-29333#problem:support-owned-query-gap-reported-as-customer-evidence-shortage",
        "https://tidb.atlassian.net/browse/APID-29338#problem:internal-provider-mechanics-enter-customer-progress-draft",
        "https://tidb.atlassian.net/browse/ST-2891#problem:reply-presentation-preservation",
        "https://tidb.atlassian.net/browse/APID-29340#problem:target-confirmation-rerun",
        "https://tidb.atlassian.net/browse/APID-29343#problem:internal-only-resolved-cluster-omitted"
      ],
      "signalTextIncludesAny": [
        "diagnosis rule in response format",
        "product fact in reply format",
        "format prompt chooses human required",
        "final wording reinterprets evidence ownership"
      ],
      "observedThrough": "2026-08-14",
      "effectiveAt": "2026-08-14T12:10:59Z",
      "verifiedAt": null,
      "attemptedAction": "Move direct-path semantic reasoning to Primary Analysis, keep diagnostic semantics with the Scenario Router, move repository product facts to indexed product knowledge, leave response format with presentation plus one already-decided customer-versus-PingCAP responsibility projection, and ignore an unknown optional Router knowledge reference without discarding the valid diagnostic route.",
      "evidenceUrl": "https://github.com/tidbcloud/aisupport/pull/922"
    }
  ]
}
-->

- Optimization ID: `primary-analysis-reply-format-boundary-2026-08-14`
- Owner: Primary Analysis, Scenario Router, Product Knowledge, and response
  presentation policy within their documented stage boundaries
- Source references: `APID-29333`, `APID-29338`, `ST-2891`, `APID-29340`, and
  `APID-29343`
- Implementation status: deployed, including the replay-discovered optional
  Router reference fix
- Effective status: `optimized_unverified`

## Bounded problem

`support-reply-format` accumulated product facts, evidence interpretation,
diagnostic convergence, escalation, risk, and decision rules. Primary Analysis
read the whole file, while the diagnostic Final Response stage was required to
remain wording-only. This made a presentation surface a competing semantic
owner and allowed the direct and diagnostic paths to drift.

## Intended change

- Keep direct-answer semantics with Primary Analysis and direct-artifact
  reasoning with the existing Primary Analysis artifact path.
- Keep Provider-backed diagnosis, evidence ownership, mitigation, severity,
  and handoff with the Scenario Router pipeline.
- Keep repository-owned product facts in the line-oriented
  `product-knowledge/` index and applicable topic files.
- Keep response format limited to language, structure, length, Jira Markdown,
  and audience projection. Preserve one presentation rule for a responsibility
  boundary already decided by the semantic owner.
- Remove old Jira case-pattern heuristics from the generic response format.

## Verification status

The ownership split was deployed to staging as image `6226da1a`. The bounded
optional-reference fix was then deployed as image `be17ee64`. Local focused
boundary tests passed `193/193`; the follow-up Router tests passed `145/145`;
both changes passed the full `823/823` suite and TypeScript type checking.

Post-deployment historical read replays ran at concurrency two:

- `APID-29333`, run `866a02d0-b8e7-4a96-8f11-b50254dad59f`: the responsibility
  projection passed, with a separate causal-strength gap in the draft.
- `APID-29338`, run `5c018da9-5b23-4367-a286-4fe27da2a0ee`: passed the
  customer/internal acquisition-detail boundary.
- `ST-2891`, run `c523444f-84e7-4885-af6b-ffd6549cf610`: passed the language,
  documentation, and message-deduplication boundary, with a separate missing
  production RU-budget caveat.
- `APID-29340`, run `c4324175-191e-4043-993d-bf82c17ba6bc`: passed the bounded
  target-only handoff shape while preserving `diagnostic_wetech_target_missing`.
- `APID-29343`, workspace `ab2dcb54-4017-4b3b-974a-26e90f7fcf6e`: failed
  before diagnosis because the Router rewrote the optional product-knowledge
  topic id as `topics-wetech-prepared-statement-boundary`; the parser discarded
  the whole route as `diagnostic_product_knowledge_ref_unknown`.

The APID-29343 failure was addressed by requiring exact candidate ids and
ignoring only an unknown optional knowledge reference while preserving valid
route fields. Post-fix read replay run
`7341b4de-cb32-4263-a44d-79074d39e5b4` completed the Router and generated both
messages. It preserved `asia-prod / Dolphinscheduler` only in the internal
handoff and did not recommend PREPARE. A separate failure remains:
`diagnostic_scenario_diagnostic_agent_budget_exhausted` after partial Wetech
evidence acquisition. No Jira refresh was performed, so the problem remains
`optimized_unverified`.

## Next validation action

Keep the APID-29333 causal-strength gap, ST-2891 RU-budget caveat, and APID-29343
Scenario Diagnostic Agent budget exhaustion as separate unresolved problems.
After those affected case drafts are corrected, rerun the applicable cases and
refresh their stable Jira internal comments before promoting this record to
`optimized_verified`.
