---
id: TASK-118.12
title: Add persistent map annotations to rmaps via Automerge
status: Done
assignee: []
created_date: '2026-03-16 00:06'
updated_date: '2026-03-16 00:50'
labels:
  - multiplayer
  - tier-5
milestone: Multiplayer Everything
dependencies: []
parent_task_id: TASK-118
priority: low
---

## Description

<!-- SECTION:DESCRIPTION:BEGIN -->
rmaps already has ephemeral WebSocket rooms for live location sharing. Add an Automerge doc layer for persistent map annotations (pins, notes, routes, areas) that survive room disconnection.

## New files:
- `modules/rmaps/schemas.ts` — MapsDoc with annotations, savedRoutes, meetingPoints
- `modules/rmaps/local-first-client.ts` — CRUD: addAnnotation, saveRoute, setMeetingPoint

## Schema:
```
MapsDoc {
  meta: { module: 'maps', collection: 'annotations', version: 1 }
  annotations: Record<string, { id, type: 'pin'|'note'|'area', lat, lng, label, authorDid, createdAt }>
  savedRoutes: Record<string, { id, name, waypoints[], authorDid }>
  savedMeetingPoints: Record<string, { id, name, lat, lng, setBy }>
}
```

Ephemeral room sync (live location) remains unchanged.
<!-- SECTION:DESCRIPTION:END -->

## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 Persistent annotations survive room disconnection
- [ ] #2 Saved routes and meeting points sync via Automerge
- [ ] #3 Ephemeral live location sharing still works unchanged
- [ ] #4 Demo mode works locally
<!-- AC:END -->

## Implementation Notes

<!-- SECTION:NOTES:BEGIN -->
schemas.ts + local-first-client.ts created
<!-- SECTION:NOTES:END -->
