Repository navigation
refactor(gateway): route each opcode to one Protocol Family - #663
Conversation
|
Local adversarial review is complete. Two independent reviewers checked routing, lifecycle ordering, behavior preservation, and repository standards. Neither found a runtime defect. I added taxi dispatch tests after review showed the old tests bypassed the production arming call. The new tests prove acceptance queues before the flight spline, a closed queue prevents arming, and arming Transport Loss propagates. They fail when arming is removed or moved before the reply. The follow-up reviewer confirmed the gap is closed. Formatting, workspace Clippy, and all 2,134 Gateway tests pass on the final commit. The earlier nine private Headless Client scenarios passed against the same production code. All nine CI checks passed on |
Gateway requests passed through a chain of handlers until one accepted the opcode. Each Protocol Family had its own context and dispatch result. Adding an opcode required changes to that chain and tests tied to those types.
This change gives each opcode one owner and each handler the same
ProtocolFamilyinterface. Handlers use shared protocol state and return replies. The World Session queues those replies before taxi arming, Reward Letter delivery, or lifecycle work. World entry retains its packet and subscription order. Tests call the same handler interface with the Stores they need.Refs #635. This is phase 5 only. Keep the issue open for phases 6 and 7.
Verification
Local verification:
78c943a1.78c943a1. All nine selected private Headless Client scenarios passed against standalone SpacetimeDB ate6682ea; the later commit adds only tests.debug_reducers, Package API lint, package-delta, shared, and test-support suites.debug_reducers.Two fresh local adversarial reviews found no runtime defect. A taxi coverage gap was fixed in
78c943a1: tests now call the production dispatch path and observe acceptance before the flight spline, no arming after a queue failure, and propagation of arming Transport Loss. Deliberately removing arming or reversing the order makes the new tests fail. The follow-up review cleared the gap. All nine CI checks passed on78c943a1: Rust, Module durable tests and Gateway bindings, and Runtime Scripts.Risk
This changes Gateway routing and reply handling across the Protocol Families. It changes no Module schema or wire format. No production Realm was used.
Built with GPT-6 Astra and GPT-6.1 Sol through the Codex harness in T3 Code.