test(telegram): delivery trace goldens for the edit-preview lifecycle#104581
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 11, 2026, 1:27 PM ET / 17:27 UTC. Summary PR surface: Source +47, Tests +340. Total +387 across 6 files. Reproducibility: not applicable. This PR creates deterministic regression oracles rather than addressing a reported runtime failure. Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Next step before merge
Security Review detailsBest possible solution: Land the focused Telegram trace coverage as an executable oracle for the current preview lifecycle while leaving runtime behavior unchanged. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR creates deterministic regression oracles rather than addressing a reported runtime failure. Is this the best way to solve the issue? Yes. Extending the existing shared trace harness at the real Telegram dispatcher boundary is narrower and less drift-prone than introducing a separate test framework or duplicating production logic. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 702ba19e3aba. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +47, Tests +340. Total +387 across 6 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
|
Merged via squash.
|
Related: #104318
What Problem This Solves
Extends the delivery trace harness (#104478) to Telegram — the derived-edit-preview reference channel whose invariants (one visible preview edited forward, finalize in place, flood-wait suspension honoring retry_after, chained pagination) the planned core preview engine must reproduce exactly.
Why This Change Was Made
Five golden scenarios drive the real message-context → dispatch → draft-stream → send pipeline with a mocked grammY API under fake timers: streaming with block boundary and finalize-in-place; final-only; cancel; flood-wait during preview (suspension holds newest snapshot, single recovery edit); overflow pagination (retained page + chained continuations, replyTo consumed exactly once). Warts pinned as Phase-4 oracles: double typing cue at turn start; 30-char initial debounce parking short partials; draft-final pagination splitting rendered HTML at hard boundaries mid-word (funnel-parity divergence — flagged separately for a fix); cancel deletes rather than finalizes the preview after dwell.
User Impact
None at runtime — test infrastructure pinning Telegram's streaming contract.
Evidence
tbx_01kx91ts1vfsbattmk598dgk7w: full telegram suite +pnpm check:changedgreen; verify-mode trace runs ×4 byte-stable (incl. warm-leasetbx_01kx90h6d5bdgsncpnpbhfq9sdreruns).replyToMode:"first"(vs prod default "off") to expose single-consumption — commented in the test.