Repository navigation
test(contract): pin per-record ban signature checks at the cap; fix debug bans the same way - #800
Merged
Merged
Conversation
…ebug bans the same way #797 made enforce_user_ban_cap judge each ban record by its own signature, because a BanId hashes the signature alone and records sharing an id were credited with each other's verdicts. Its regression tests were held back until the fixed contract was published (live at 30000404). They cover the owner pool, first-of-pair, and the unknown-target live branch, each in two input orders and comparing whole records; all three fail on the code before the fix. riverctl's debug bans classifier read the same id-keyed verdicts; it now checks each record's own signature first. Display only.
- The first-of-pair test gets an older competing live ban, so it fails if only the first-of-pair filter is removed. - New: a copy differing only in owner_member_id matches the genuine ban's first-of-pair rank, so only the per-record check in live() kills it; it fails if only that check is removed. - Record comparison includes owner_member_id. - Rewrap the classify_ban doc.
sanity
commented
Oct 16, 2026
sanity
left a comment
Contributor
Author
There was a problem hiding this comment.
Review #800 (Light tier, HEAD 46758dd)
Lenses: skeptical and testing, each reading blind. No blocking findings.
- Fixed: the first-of-pair test only failed if both overlapping guards were removed. It now has a competing older live ban, and a new
owner_member_id-only copy test pins the per-record check inlive()on its own. Confirmed by mutation: removing only the filter fails the first-of-pair test, and removing only thelive()check fails the new test. - Fixed: record comparison now includes
owner_member_id, and theclassify_bandoc is rewrapped. - Not done (optional suggestions): a deputy-issuer variant with a known target, and a non-owner-issuer CLI case. The per-record gate sits ahead of both branches, and the existing
ban_signed_by_someone_other_than_its_attributed_banner_is_inertcovers the non-owner CLI path.
CI is green on 46758dd.
[AI-assisted - Claude]
sanity
added a commit
that referenced
this pull request
Oct 16, 2026
Conflicts: cli/CHANGELOG.md, where #800's Fixed entry moves under this branch's [0.2.23] section, and a test-module hunk in ui/src/room_data.rs, where both sides' tests are kept. Main's committed WASMs are unchanged (room 057ec3ae, delegate eca06ace), so V36 still names them. Claude-Session: https://claude.ai/code/session_019J28r7v39Pf1XZDNUUAidG
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #797, which is now merged and published (webapp 30000404, riverctl 0.2.22).
What
BansV1::enforce_user_ban_capstarted judging each ban record by its own signature against its claimed issuer. Before that, it readresolve_bans' verdicts byBanId, which hashes the signature alone, so records sharing an id were credited with each other's verdict. That fix's regression tests were held out of fix(contract): evict bans at max_user_bans by age within owner and other pools (#796) #797 until the fixed contract was live. This PR adds three, one per path: the owner pool, first-of-pair, and the unknown-target live branch.riverctl debug bans.classify_banread the same id-keyed verdicts, so a record copying another ban's signature was displayed with that ban's status. It now checks each record's own signature first. This is display only: the contract already drops such records at cleanup step 4.record_copying_a_genuine_bans_signature_is_inert, which fails without the fix.No contract or delegate WASM change: only
cli/andcommon/tests/are touched.Testing
cargo test -p river-core --test mutual_rejection_test(84 passed) andcargo test -p riverctl --lib(423 passed).[AI-assisted - Claude]