Skip to content

refactor(gateway): route each opcode to one Protocol Family - #663

Merged
Mathih13 merged 2 commits into
mainfrom
t3/check-issue-635-status
Oct 11, 2026
Merged

Mathih13 merged 2 commits into
mainfrom
t3/check-issue-635-status

Conversation

@Mathih13

@Mathih13 Mathih13 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor

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 ProtocolFamily interface. 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:

  • Formatting and workspace Clippy with all targets, all features, and warnings denied passed at 78c943a1.
  • Gateway: 2,134 tests passed at 78c943a1. All nine selected private Headless Client scenarios passed against standalone SpacetimeDB at e6682ea; the later commit adds only tests.
  • Importer, Module unit tests with debug_reducers, Package API lint, package-delta, shared, and test-support suites.
  • Module Wasm check with 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 on 78c943a1: 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.

@Mathih13

Mathih13 commented Oct 11, 2026 •

Copy link
Copy Markdown
Contributor Author

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 78c943a1. Merged as ee138374; each opcode now selects one Protocol Family through the shared handler interface. No live Realm or graphical client was used.

@Mathih13
Mathih13 merged commit ee13837 into main Oct 11, 2026
9 checks passed
@Mathih13
Mathih13 deleted the t3/check-issue-635-status branch October 11, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant