fix
patch
task/fix-ops-commute-addressed-ops
#1 / 1
fix: ops_commute handles AddressedInsertOp/AddressedDeleteOp (no position key)
Both op types share op=="insert"/"delete" with InsertOp/DeleteOp but have no position field. ops_commute was doing a["position"] unconditionally, causing KeyError during muse pull when the code domain generated AddressedInsertOps.
Fix: guard with "position" not in a/b before accessing the field. The semantic is: AddressedOps at the same address are a conflict; at different addresses they commute. This matches the Map-CRDT address-keyed commutativity described in the module docstring.
Nine new tests in TestOpsCommuteAddressedOps cover the previously untested paths.
sha256:26e130b630b6a51f141dc4cc495ddfd11a1186ef4407b9530ed1c8ae528cd3ce
sha
+14
~8
symbols
sha256:0859d6df4a76ce54cf1a432aff58fabc4e33c058ed8adab40f10b604e788be81
snapshot
+14
symbols added
~8
symbols modified
0
dead code introduced
Semantic Changes
22 symbols
+
docs/
+
muse/
+
tests/
+
tools/
+
test_addressed_delete_and_move_commute
method
method test_addressed_delete_and_move_commute L684–688
+
test_addressed_deletes_at_different_addresses_commute
method
method test_addressed_deletes_at_different_addresses_commute L668–671
+
test_addressed_deletes_at_same_address_commute_consensus
method
method test_addressed_deletes_at_same_address_commute_consensus L673–677
+
test_addressed_insert_and_addressed_delete_different_addresses_commute
method
method test_addressed_insert_and_addressed_delete_different_addresses_commute L679–682
+
test_addressed_insert_inside_patch_commutes_at_different_addresses
method
method test_addressed_insert_inside_patch_commutes_at_different_addresses L695–699
+
test_addressed_insert_inside_patch_conflicts_at_same_address
method
method test_addressed_insert_inside_patch_conflicts_at_same_address L701–704
+
test_addressed_inserts_at_different_addresses_commute
method
method test_addressed_inserts_at_different_addresses_commute L657–660
+
test_addressed_inserts_at_same_address_do_not_commute
method
method test_addressed_inserts_at_same_address_do_not_commute L662–666
+
test_move_and_addressed_delete_commute
method
method test_move_and_addressed_delete_commute L690–693
~
DeleteOp
~
DomainOp
~
InsertOp
~
MoveOp
~
PatchOp
← Older
Oldest on task/fix-ops-commute-addressed-ops
All commits
Newer →
Latest on task/fix-ops-commute-addressed-ops
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:26e130b630b6a51f141dc4cc495ddfd11a1186ef4407b9530ed1c8ae528cd3ce --body "your comment"
No comments yet. Be the first to start the discussion.