Skip to content

test(contract): pin per-record ban signature checks at the cap; fix debug bans the same way - #800

Merged
sanity merged 2 commits into
mainfrom
test/forged-ban-records
Oct 16, 2026
Merged

sanity merged 2 commits into
mainfrom
test/forged-ban-records

Conversation

@sanity

@sanity sanity commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #797, which is now merged and published (webapp 30000404, riverctl 0.2.22).

What

No contract or delegate WASM change: only cli/ and common/tests/ are touched.

Testing

cargo test -p river-core --test mutual_rejection_test (84 passed) and cargo test -p riverctl --lib (423 passed).

[AI-assisted - Claude]

…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 sanity left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 in live() on its own. Confirmed by mutation: removing only the filter fails the first-of-pair test, and removing only the live() check fails the new test.
  • Fixed: record comparison now includes owner_member_id, and the classify_ban doc 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_inert covers the non-owner CLI path.

CI is green on 46758dd.

[AI-assisted - Claude]

@sanity
sanity merged commit 6544554 into main Oct 16, 2026
7 checks passed
@sanity
sanity deleted the test/forged-ban-records branch October 16, 2026 14:31
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
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