utils/crdt-sync/crdt_sync
Krzysztof kuhy Rudnicki 2005c40baa
Some checks are pending
crdt-sync pre-commit / pre-commit (push) Waiting to run
crdt-sync tests / test (3.10) (push) Waiting to run
crdt-sync tests / test (3.11) (push) Waiting to run
crdt-sync tests / test (3.12) (push) Waiting to run
palette drift / palette (push) Waiting to run
Group sync_log's 11 arguments into three bundles
BREAKING: sync_log's flat keyword arguments are replaced by SyncTarget,
LogCodec and RevisionTracking. Callers change from eleven loose keywords to
four positional arguments; every consumer repo is updated in the same pass.

Eleven parameters on one function was the last real pylint finding in the
package, and the grouping is the fix rather than a workaround: the three
bundles are the three things a tick actually needs -- where to sync, how to
serialize, and whether to track revisions -- and each documents its own
fields. SyncTarget.own_ids also moves the "this device plus its pre-migration
id" rule onto the type that owns it, instead of recomputing it inline.

Internals follow: _pull_remote_logs takes a _PullContext instead of eight
positionals, and the push half splits into _merge_peers/_push, which is what
clears the 21-locals finding.

The two duplicated in-memory fakes merge into one FakeStore in conftest, as
does the no-bulk-read wrapper around it -- the shared half was the fiddly
prefix slicing, which is exactly where two copies drift.

crdt_sync now scores a clean 10.00/10 on pylint. Two suppressions remain,
both scoped and explained at the line: asserting on a private attribute IS
the timeout test, and reversing merge_record's operands IS the commutativity
test.

259 tests, still 100% branch coverage.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCucBhUkHBBHHbsY7bSdGV
2026-08-21 14:22:25 +02:00
..
tests Group sync_log's 11 arguments into three bundles 2026-08-21 14:22:25 +02:00
__init__.py Group sync_log's 11 arguments into three bundles 2026-08-21 14:22:25 +02:00
_config.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_device.py Add DeviceIdentity and a legacy device id for the uuid migration 2026-08-09 16:54:33 +02:00
_firebase_auth.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_firebase.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_github.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_hlc.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_http.py Pool HTTP connections, and let callers set the Firebase timeout 2026-08-21 13:55:01 +02:00
_log.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_mirror.py Let a mirror read survive the primary being down 2026-08-10 14:30:29 +02:00
_record.py Initial implementation: unified CRDT merge scheme + GitHub sync transport 2026-07-05 20:40:09 +02:00
_remote.py crdt_sync: add a Firebase Realtime Database transport behind a RemoteStore seam 2026-08-03 18:14:25 +02:00
_store.py Add LogStore local-persistence layer to crdt_sync (v0.2.0) 2026-07-11 22:19:34 +02:00
_sync.py Group sync_log's 11 arguments into three bundles 2026-08-21 14:22:25 +02:00