# Preserve Lark bridge follow-up context and comparison authorship

<!-- auto-oncall-optimization-record
{
  "schemaVersion": "auto-oncall-optimization-record-v1",
  "optimizationId": "lark-bridge-followup-context-2026-08-03",
  "problems": [
    {
      "problemId": "lark-bridge-followup-treated-as-support-or-ignored",
      "summary": "A Lark-bridged customer follow-up can be treated as a support reply or omitted from the final simulated draft, producing a stale answer and an invalid AI-versus-human comparison.",
      "status": "optimized_verified",
      "issueKeys": ["ST-2854"],
      "sourceRefs": [
        "auto-oncall-report:staging:daily:2026-07-29:case:ST-2854#problem:ai_gap:04c71f4a262a4f0a"
      ],
      "signalTextIncludesAny": [
        "未看到表结构和执行计划",
        "后续执行计划与数据分布证据未进入回答",
        "Lark bridge follow-up",
        "人工回复归属错误"
      ],
      "observedThrough": "2026-08-03",
      "effectiveAt": "2026-08-03T10:13:22.000Z",
      "verifiedAt": "2026-08-05T04:05:15Z",
      "attemptedAction": "Recognize Lark bridge speakers in the shared workspace and report-comparison paths, strip the bridge envelope consistently, and normalize the supplemented follow-up draft instead of the stale initial draft.",
      "evidenceUrl": "https://tidb.atlassian.net/browse/ST-2854?focusedCommentId=23354939"
    }
  ]
}
-->

- Optimization ID: `lark-bridge-followup-context-2026-08-03`
- Owner: auto-oncall-services
- Source reference: ST-2854
- Implementation status: deployed to staging in aisupport PR `#602`, revision
  `e1808bcb0a7f293998b0a9dc25f7e44dab84e88f`
- Effective status: `optimized_verified`

## Bounded problem

The shared workspace parser recognized Slack bridge envelopes but not the
equivalent Lark group form. In ST-2854 this could misattribute a customer
follow-up as support-authored evidence, select the wrong replay boundary, and
normalize the stale initial draft after supplemental context was present. The
same envelope mismatch also made the report comparison treat bridged customer
text as a human support answer.

## Implementation

- Recognize `Comment by ... from Lark group:` alongside the existing Slack
  envelope in workspace speaker resolution and body normalization.
- Apply the same identity rule in report comparison, including the
  markdown-wrapped bridge header.
- When a replay target includes the initial follow-up window and a supplement
  was received, normalize the generated `nextDraftMarkdown` rather than the
  stale initial draft.

## Verification evidence

- Contract tests cover Lark bridge identity, historical cutoff selection,
  customer-versus-support comparison attribution, and supplemented draft
  normalization. Full repository tests passed: 614/614.
- The case-specific equivalent evaluation produced the reviewed ST-2854 draft
  from the supplied row counts and bounded its deeper explanation to index,
  statistics, or parameterized-plan hypotheses pending representative plan
  comparison.
- The exact merged revision reached the staging Deployment at
  `2026-08-03T10:13:22Z`; the replacement Pod was Ready with zero restarts and
  both health endpoints returned HTTP 200.
- At the user's direction, the reviewed draft was not regenerated with another
  replay. Jira internal comment `23354939` was updated in place by direct API
  `PUT`; readback confirmed the same ID, `public=false`, the corrected draft,
  and `自动回答: 是；人工处理: 否`.
- ST-2854 remained in Jira status `已解决`; no transition, duplicate comment,
  customer-visible reply, DB run, evaluation row, or Base history rewrite was
  performed.
- Post-deployment historical replay `ef3a338a-d5bc-4118-b1e8-8af5b2457f1b`
  selected target comment `23354943`, excluded Lark-bridged support envelopes,
  retained the customer evidence inside the five-minute supplement window, and
  generated the answer from the supplied row counts and execution-plan facts.
  The single-case judge returned `ai_better`.
- Existing internal comment `23354939` was updated in place with the verified
  replay draft. API readback at `2026-08-05T04:05:15Z` confirmed the same ID,
  `public=false`, and the exact expected body.

## Unresolved gaps

- The final choice between candidate indexes still depends on representative
  `EXPLAIN ANALYZE` or Plan Replayer evidence; that is a case evidence gap, not
  the bridge-context defect fixed here.

## Next validation action

Monitor later Lark-bridged follow-ups for a regression in speaker identity,
supplement-window selection, or stale-draft normalization. Do not treat the
remaining plan-choice evidence gap as a regression of this verified boundary.
