Prevent duplicate Lark worker returns after an upgrade #9330
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.50) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.50 · 443 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.365
Shallow Review Depth
shallow_review_depth
0.344
Ai Authored
ai_authored
0.050
Real PR Conversation Timeline
1 comments
"Review active on #9330"
general
weight: 0.35
BigDataDZ
Goal and delivered outcome
Recover a worker result in its original conversation after upgrading from a sender which could exit between the provider accepting a message and saving its ID. The old queue and transcript look identical when the sender exits just before posting. Replaying the first history can send a second copy. The candidate preserves the original conclusion and reports the ambiguous delivery as unconfirmed.
Related to #9318. Base branch
main.Author declaration
docs/reference/local-delegation.md(interrupted result return) anddocs/architecture/rfcs/app-conversation-and-async-inbox-v0.md(a started write without a provider locator stays unconfirmed after restart), atfd985b1ac9.Implementation and scope
The original transcript row records the provider on first insertion for a checkpoint-aware sender. Returning an existing row preserves its historical metadata. The TypeScript delivery owner checks the original dispatch information and persists the verification checkpoint under its existing revision and grant checks. With multiple transports configured, the stored binding selects the protocol. Sending still verifies the live audience. The Lark adapter consults that result immediately before posting. The provider marker by itself grants no authority and proves no delivery.
An untouched result can still be sent once. A saved provider message ID is verified through its original route. A legacy transcript without dispatch evidence can represent a genuine preflight interruption. Its original result remains readable and its external delivery remains unconfirmed, including when the actual number of posts is zero.
Validation
b280ef5c515c2039b37ac9ac881e19d4f32d4a34| Check | Result | Evidence and scope |
| --- | --- | --- |
| Static | Passed | Control-plane TypeScript type check. |
| Unit/integration | Passed | All 65 TypeScript manager return transaction and steward topic tests. |
| Real entrypoint / recovery | Passed | With the same older sender and identical restart harness, the base delivered two copies when the provider accepted before the ID was saved. The installed candidate retained one copy. With a saved ID both delivered exactly one. An untouched result reached the provider once. A legacy preflight interruption stayed unconfirmed with zero posts on the candidate. All four candidate cases passed. |
| Python integration | Passed | 412 affected tests and 12 transport-composition tests. These include interrupted/revoked sends, storage restart, topic routing, and transient provider observation with multiple transports configured. The fresh result delivered once when observation recovered. |
| Premerge | Passed | All 10 diff-selected canaries passed, including the full vocabulary scan. The earlier head hit the scan timeout. |
| Regression sensitivity | Confirmed | The same cross-version oracle failed in both ambiguous cases on the target base and passed on the candidate. One candidate characterization initially encountered a reused test temporary directory before recovery could run. Repeating all four cases with a fresh directory passed with identical assertions. |
Existing delivery status and transcript surfaces display the outcome. UI impact: none. No production Lark account or message was used. Rollout and installed-service adoption require a merged build. Every commit has DCO sign-off.