Ajuste les ports et le bootstrap applicatif, ainsi que le mapping Drift des repositories, pour préparer une future synchronisation cloud (invariants documentés dans docs/sync-invariants.md). Corrige au passage un bug de fuseau horaire UTC dans le mapping Drift. flutter analyze propre, 35/35 tests verts, build APK debug validé. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1.4 KiB
Sync invariants
GameTime remains offline-first. The current sync surface is preparatory only: there is no server protocol, remote auth, or network adapter yet.
Local mutation log
Every local mutation of a syncable aggregate must update the row metadata and
append a change_log entry in the same local transaction.
Required row metadata:
idis stable and generated locally.updatedAtis the logical mutation timestamp.syncStateisdirtyfor local writes anddeletedfor soft deletes.localRevisionincreases when an existing row changes.originDeviceIdidentifies the device that produced the row mutation.futureOwnerProfileIdis nullable until user profiles exist.
change_log.operation currently supports insert, update, softDelete, and
restore. Exercise archive/unarchive is represented as update because the row
is not deleted and the current schema has no archive operation.
Future conflict policy
Conflict resolution is not implemented yet. The intended first server strategy is
last-write-wins per entity using updatedAt, with localRevision and
originDeviceId retained for diagnostics and later upgrade. Vector clocks are not
implemented and are not assumed by the current model.
Future profiles
The profile boundary will attach to futureOwnerProfileId. Until profile support
is added, rows keep it nullable and sync code must not infer ownership from local
device IDs.