Skip to content

feat(core): peer scoring service and MemberInfo UI type#53

Merged
seemenkina merged 2 commits intomainfrom
feat/peer_scoring
Mar 18, 2026
Merged

feat(core): peer scoring service and MemberInfo UI type#53
seemenkina merged 2 commits intomainfrom
feat/peer_scoring

Conversation

@seemenkina
Copy link
Copy Markdown
Collaborator

@seemenkina seemenkina commented Mar 18, 2026

Summary

  • Add peer scoring infrastructure split across core (protocol vocabulary) and app (service + defaults), following the core/app layer separation
  • Introduce MemberInfo struct in UI protocol to carry member scores alongside addresses
  • Storage is group-scoped: PeerScoreStorage keyed by (group_id, member_id), service designed as one-per-User
  • apply_consensus_result now returns ConsensusApplyResult with Vec

What's where

  • core::peer_scoring — ScoreEvent (9 variants), ScoreOp, ScoringProvider trait, PeerScoreStorage trait, ScoringConfig, ConsensusApplyResult
  • app::peer_scoring — PeerScoringService<S, P>, InMemoryPeerScoreStorage, FixedScoringProvider
  • de_mls_ui_protocol — MemberInfo { address, score } replaces String in GroupMembers event
  • Gateway — maps member addresses to MemberInfo with default score 100

Test plan

  • New peer scoring tests (add/remove, apply events, threshold detection, saturation, cross-group isolation, determinism)
  • All existing tests pass
  • Clippy clean, docs build without warnings
  • Full workspace builds (de-mls, ui-protocol, gateway, desktop-ui)

- Updated the UI to utilize a new `MemberInfo` structure, which includes member addresses and peer scores, improving member management in group chats.
- Refactored the `ChatState` to store `MemberInfo` instead of raw addresses, allowing for better representation of member data.
- Enhanced the `get_group_members` function to return `MemberInfo` objects, providing additional context for each member.
- Updated README instructions to reflect changes in node configuration for improved clarity.
@seemenkina seemenkina merged commit 4fba916 into main Mar 18, 2026
4 checks passed
@seemenkina seemenkina deleted the feat/peer_scoring branch March 18, 2026 10:30
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