You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: separate Relay tests and Group mirror rules - #685
Relay tests for many Protocol Families shared two central files, each over 4,000 lines. Group commands and World Shard mirror rules also shared one file. These mixed responsibilities made the code harder to navigate.
Move Relay packet and audience tests beside their Protocol Families. Keep shared routing, queue, lifetime, and reconciliation tests central. Extract Group mirror rules and their tests into group/mirror.rs, with the existing reducer re-exported from group.rs.
The central Relay files shrink to 1,772 and 1,771 lines. The Group file shrinks from 3,538 to 2,975 lines. The importer is outside this change.
What you verified
cargo test -p lyracore-gateway: 2,000 unit tests and 11 other tests passed. The default run ignored 31 tests.
cargo test -p lyracore-module --lib --features=debug_reducers: 1565 passed; 0 failed.
Module build_script and package_api_lint targets: 7 and 37 tests passed.
Module instance_removal and raid_convert targets, including ignored tests: 5 and 7 tests passed against disposable local SpacetimeDB instances.
Gateway durable roster Relay test: 1 passed; 0 failed. A Realm-core roster change reached every World Shard mirror.
No real-client check or migration of an existing Realm. The complete durable suite and unrelated crate test suites were not run locally.
Risk
This refactor preserves runtime behavior, reducer arguments, table definitions, and packet formats. The main risk is a missed test or changed mirror rule during extraction. Test inventory checks, durable tests, and separate standards and scope reviews cover those risks.
Notes for the reviewer
The two commits separate Relay test placement from Group mirror extraction. Most of the diff moves existing code. No unresolved review findings remain.
Model: GPT-6 Astra, high reasoning effort. Harness: Codex in T3 Code.
Independent adversarial review of 51c48384 found no actionable defects. The Gateway test moves preserve all 218 tests and 699 assertions in the changed files. The Group extraction preserves the reducer signature, executable body, ordering, authority checks, and side effects. Its tests retain all 92 assertions.
All nine CI checks passed at this head, including Rust, the durable suite and binding comparison, and Runtime Scripts. I checked the actual Group mirror, Instance Removal, and roster Relay results. No repairs were needed. The importer is unchanged.
Merged as ff2e6d6b. A follow-up adversarial review confirmed the merged patch matches the reviewed code exactly and has no material interaction with the concurrently merged Realm-core outage change. Combined Gateway and Module tests also passed at 6c23be8e. No real-client or live Realm check was performed. Independent reviewer and implementing agent used GPT-6 Astra at high effort through Codex.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relay tests for many Protocol Families shared two central files, each over 4,000 lines. Group commands and World Shard mirror rules also shared one file. These mixed responsibilities made the code harder to navigate.
Move Relay packet and audience tests beside their Protocol Families. Keep shared routing, queue, lifetime, and reconciliation tests central. Extract Group mirror rules and their tests into
group/mirror.rs, with the existing reducer re-exported fromgroup.rs.The central Relay files shrink to 1,772 and 1,771 lines. The Group file shrinks from 3,538 to 2,975 lines. The importer is outside this change.
What you verified
cargo test -p lyracore-gateway: 2,000 unit tests and 11 other tests passed. The default run ignored 31 tests.cargo test -p lyracore-module --lib --features=debug_reducers:1565 passed; 0 failed.build_scriptandpackage_api_linttargets: 7 and 37 tests passed.instance_removalandraid_converttargets, including ignored tests: 5 and 7 tests passed against disposable local SpacetimeDB instances.1 passed; 0 failed. A Realm-core roster change reached every World Shard mirror.cargo clippy --workspace --all-targets --all-features -- -D warningsandcargo fmt --all -- --checkpassed.python3 scripts/check-gateway-bindings.py:All 1184 Gateway binding files are current.The Module integration command used the macOS linker option below for SpacetimeDB host symbols. Durable tests executed the real Wasm Module.
What you did NOT verify
No real-client check or migration of an existing Realm. The complete durable suite and unrelated crate test suites were not run locally.
Risk
This refactor preserves runtime behavior, reducer arguments, table definitions, and packet formats. The main risk is a missed test or changed mirror rule during extraction. Test inventory checks, durable tests, and separate standards and scope reviews cover those risks.
Notes for the reviewer
The two commits separate Relay test placement from Group mirror extraction. Most of the diff moves existing code. No unresolved review findings remain.
Model: GPT-6 Astra, high reasoning effort. Harness: Codex in T3 Code.