Imported from uspcodelab/webmun (
backend/AGENTS.md). Install upstream withnpx skills add uspcodelab/webmun --skill backend. Copyright stays with the author.
Backend guidance
SessionLiveStateis the authoritative engine state. IDs in queues, speakers, votes, roll calls, motions, and questions arerepresentation_idvalues.- Authenticate websocket users into a server-built
SessionActor; never trust a client-supplied delegation identity. Validate chair-selected target IDs againststate.delegations. - Keep
delegationskeyed by representation ID. Iterate with.values()only when context data is needed. - State snapshots are persisted and reloaded. Make state-model changes deliberately and provide a migration/versioning path when stored snapshots would become incompatible.
- Run
cd backend && pytest -qafter backend behavior changes.