---
id: TASK-118.2
title: Add multiplayer sync to rchoices (voting/ranking sessions)
status: Done
assignee: []
created_date: '2026-03-16 00:05'
updated_date: '2026-03-16 00:50'
labels:
  - multiplayer
  - tier-2
milestone: Multiplayer Everything
dependencies: []
parent_task_id: TASK-118
priority: medium
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
rchoices is currently a stateless voting UI. Add Automerge-backed real-time sync for live collaborative voting sessions.

## New files:
- `modules/rchoices/schemas.ts` — ChoicesDoc with votingSessions, votes, rankings
- `modules/rchoices/local-first-client.ts` — CRUD: createSession, castVote, updateRanking

## Schema design:
```
ChoicesDoc {
  meta: { module: 'choices', collection: 'sessions', version: 1 }
  sessions: Record<string, { id, title, type: 'vote'|'rank'|'score', options: [], createdBy, createdAt }>
  votes: Record<string, { sessionId, participantDid, choices: Record<optionId, number>, updatedAt }>
}
```

## Component updates (`folk-choices-*.ts`):
- Init local-first client, subscribe to doc changes
- Real-time vote tally updates as participants vote
- Show participant count and live results
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Voting sessions sync in real-time between participants
- [ ] #2 Vote tallies update live as votes come in
- [ ] #3 Session creator can configure vote type (single/multi/ranked)
- [ ] #4 Demo mode works with local-only state
<!-- AC:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
schemas.ts + local-first-client.ts + folk-choices-dashboard.ts updated with multiplayer sessions, voting, LIVE indicator
<!-- SECTION:NOTES:END -->
