.tasks/core/LSYNC-002-metadata-sync.md
Implement synchronization for truly shared resources (ContentIdentity, Tags) using the HLC-based log model. These resources can be modified by any device and need conflict resolution.
Architecture: Log-based sync with Hybrid Logical Clocks for ordering.
Shared Resources (this task):
Device-Owned (separate - state-based):
Syncable traitcommit_shared() in TransactionManager:
sync.dbsync.db (per-device log)SharedChange message with HLCDevice A: Creates tag "Vacation" → HLC(1000,A)
Device B: Creates tag "Vacation" → HLC(1001,B)
Resolution: Deterministic UUID from name
Both generate: Uuid::v5(NAMESPACE, "Vacation")
Same UUID → automatically merge
Device A: Adds entry-1 to "Summer" → HLC(1000,A)
Device B: Adds entry-2 to "Summer" → HLC(1001,B)
Resolution: Union merge
Album contains: [entry-1, entry-2]
sync.db per-device log implementation with PeerLogcore/src/infra/sync/NEW_SYNC.md - Shared resource sync