Repository navigation
refactor(group): bound roster reads by Group kind - #606
Conversation
A Party mirror with 6 to 40 rows is damaged. The Raid-cap change in #604 let it pass party_facts, admit_party_command and admit_party_command_authority. Each now bounds the roster read by the member cap of the Group's kind. One helper, bounded_roster, replaces the four copies of the capped read and its length check. Refs #534 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 18 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (3)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Code review:
|
The authority reducer refused a 6-member Party list on the expected-list check before the roster bound ran, so the first test did not prove the bound. The new test applies an admitted Companion Order against a 6-row Party mirror, and a Raid of 10 in the existing test passes the same bound. party_facts reuses its unavailable closure for the roster bound. Refs #534 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
sync_group_mirror accepted a Party of 6 to 40 members, the same state the readers call damaged. It now refuses more members than the Group kind holds. The portal Gate read reuses bounded_roster with the Party cap. The authority reducer defines its stale closure once. The tests use one mirror builder and plant a damaged Party by turning a mirrored Raid of six into a Party. Refs #534 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Addressed all findings in 5fe2fc4.
Claude Sonnet 5.5 in Claude Code. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review of #604 found two problems in the roster bounds.
A Party mirror with 6 to 40 rows is damaged.
party_facts,admit_party_commandandadmit_party_command_authoritybounded every Group at the Raid cap, so such a mirror passed. Four places also repeated the same capped roster read and length check.Each of these now reads the roster through
bounded_roster. It takes the Group kind and bounds the read byGroupKind::member_cap. A Raid keeps its 40-member bound. A Party is bounded at 5 again. The error each site returns is unchanged.has_known_party_member_in_partitionalso uses the helper, with the Party cap on purpose. The debug fixture inbridge.rsuses it too.The mirror writer now refuses the damage at the boundary.
sync_group_mirrorrefuses more members than the Group kind holds. Packages stage at most 5 rows for a Party and 10 for a Raid, so they are not affected. The reader bounds stay as defence in depth.Tests:
a_world_shard_mirror_refuses_a_party_past_five: the writer refuses a Party of 6 and leaves no Group row. A Party of 5 and a Raid of 6 pass.a_party_mirror_past_five_is_stale_at_both_companion_order_readers: the writer now blocks a damaged Party, so the test plants one with an SQL update that turns a mirrored Raid of six into a Party. The certified list matches the rows, so only the Party cap can refuse. Both the authority reducer andapply_admitted_party_commandrefuse. With the target site forced toGroupKind::Raid, the test fails.a_raid_past_five_certifies_a_companion_order_for_any_memberalso applies an order in a Raid of 10. It passes the same bound.Not covered: the roster bound in
party_facts. It is not a reducer. A fixture reducer to reach it would add a generated Gateway binding, so I left it out. The packages suite covers it after a repin.Refs #534
Test commands (all pass):
cargo test -p lyracore-module --test raid_convert -- --ignored(6 tests)cargo test -p lyracore-module --lib --features=debug_reducers group::(27 tests)cargo clippy -p lyracore-module --all-targets --features=debug_reducers(no warnings)cargo check --target wasm32-unknown-unknown -p lyracore-module --features=debug_reducersWritten by Claude Sonnet 5.5 in Claude Code.
🤖 Generated with Claude Code