feat: implement 3 missing plan items — property tests, format_version, schema auto-dispatch
Three gaps from the supercharge plan now fully implemented:
1. **hypothesis property-based tests** (`tests/test_property_based.py`) - All six CRDT types (LWWRegister, VectorClock, ORSet, RGA, AWMap, GCounter) verified against commutativity, associativity, and idempotency with @given - LCS round-trip: self-diff → empty ops, empty-base, empty-target, content provenance, op-count upper bound - OT diamond property: for arbitrary concurrent InsertOp pairs, applying transform() in either order produces identical final sequences
2. **Bug fixes discovered by hypothesis** - LWWRegister.join: non-commutative when (timestamp, author) tie but values differ — added value as deterministic tiebreaker - RGA.join: non-commutative when same element ID has different values across replicas — added lexicographic value tiebreaker
3. **CommitRecord.format_version** (`muse/core/store.py`) - New field tracks schema evolution: 1=base, 2=structured_delta, 3=sem_ver, 4=agent provenance; new commits write version 4; old JSON defaults to 1
4. **snapshot_diff() auto-dispatch** (`muse/core/diff_algorithms/__init__.py`) - Public function: given a DomainSchema + two SnapshotManifests → StructuredDelta - ScaffoldPlugin.diff() now delegates to snapshot_diff() — zero set-algebra boilerplate - New plugin authors call snapshot_diff(self.schema(), base, target) for free file-level diffs without implementing diff() from scratch
All verified: 1319 pytest tests green, mypy 0 errors, typing_audit 0 violations.
Comments
0No comments yet. Be the first to start the discussion.