Social modules summary

← Back to docs · Architecture · Decisions · Previous: Archives · Next: Hypergrid

Status: accepted (19 of 19 tasks, 7 sections, 444 tests). Security review verdict: CONDITIONAL PASS. Change: openspec/changes/social-modules/.

What was built

The social subsystems from OpenSim/Addons/Groups/ (~9,194 lines), OpenSim/Region/OptionalModules/Avatar/ (~5,600 lines) and supporting services (~6,800 lines), totalling ~21,600 lines of C# across ~35 files. Ported as ~12,500 lines of Rust with 444 tests.

SectionAreaTasks
1Groups V2 data model, service, HTTP handlers1.1-1.3
2Groups region module, messaging, HG connector2.1-2.3
3OfflineIM service and region module3.1-3.2
4User profiles data, service, region module4.1-4.3
5NPCs: NPCAvatar, NPCModule, tests5.1-5.3
6Concierge and IRC bridge6.1-6.2
7Integration tests, protocol replay, security review7.1-7.3

Architecture

Groups V2

GroupsModule (region) ←→ GroupsServiceRemoteConnector ←→ GroupsService (Robust)
                                                              ↓
                                                         GroupsData (sqlx)
GroupsMessagingModule: group IMs via MessageTransferModule
HGGroupsServiceConnector: Hypergrid group federation

Only the V2 data model is ported. The service exposes the same HTTP endpoints as C# Robust for mixed-grid compatibility during cutover. The legacy XmlRpc connector (3,991 lines) is dropped.

NPCs

NPCAvatar implements the IClientAPI trait as a no-op fake viewer. Only methods actually called by NPCModule have real bodies; the rest are no-ops. OSSL osNpc* functions call into NPCModule.

Module breakdown

ModuleLinesTestsResponsibility
groups.rs (service)2,20114Data model, CRUD, HTTP handlers
groups/mod.rs (module)1,49720Region-side GroupsModule, packet handling, caps
groups/messaging.rs75616Group IM routing, notices with attachments, session chat
groups/hg_connector.rs1,26220HG federation, ForeignImporter, cache wrapper
offline_im.rs92917Service + module, store/retrieve, login delivery
profiles.rs95111Data model, service, BasicProfileModule, picks, classifieds
npc_avatar.rs241-IClientAPI fake viewer
npc/mod.rs74212Create/move/say/sit/stand/remove, appearance cloning
concierge.rs53610Lobby announcements, HTTP broker notifications
irc_bridge.rs76113IRC-to-in-world chat, channel mapping, reconnect
Integration tests1,40836Group round-trip, offline IM, profiles, NPC lifecycle
Protocol replay96117Group packets, profile caps, offline IM from C# recordings

Key decisions

  • SM1: Port Groups V2 only. The V2 implementation is cleaner, supports HG, and is the default in 0.9.3.0. The XmlRpc connector is legacy (3,991 lines dropped).
  • SM2: NPC avatar stubs: NPCAvatar has ~1,400 lines of IClientAPI stubs in C#. Only methods actually called by NPCModule are implemented; the rest are no-ops (241 lines vs 1,400).
  • SM3: IRC bridge uses the irc crate (MPL-2.0, GPLv3-compatible) instead of porting the C# IRC client code.
  • SM4: OfflineIM uses the same sqlx backend as other services, no separate storage engine.

Tests

444 tests total (391 unit/lib + 36 integration + 17 protocol replay). Integration tests cover group create/join/leave/IM round trip, offline IM store/deliver, profile update/query, and NPC lifecycle. Protocol replay tests verify wire compatibility against C# recordings.

Security review

[!WARNING] CONDITIONAL PASS: 0 critical, 3 high, 10 medium tracked for remediation. See security review for details.

Full report: security-review-social-modules.md.

IDSeverityFinding
H-1HIGHIRC protocol injection via avatar names and chat messages
H-2HIGHGroup creation missing role power check at service layer
H-3HIGHGroup notice attachment size unbounded

All 3 HIGH findings require remediation before production. The IRC bridge must not go live until H-1 is fixed. 10 MEDIUM findings relate to missing size limits and input sanitization.

Commits

HashDescription
e3dc382Sections 1, 3-6: Groups V2 service, OfflineIM, Profiles, NPCs, Concierge, IRC bridge
4061c14Section 2: Groups V2 region modules: GroupsModule, messaging, HG connector
e5997a1Section 7: integration tests, protocol replay, security review