24 lines
705 B
Python
24 lines
705 B
Python
"""Deterministic delta-sync placeholder for MVP."""
|
|
|
|
from typing import List
|
|
|
|
|
|
def merge_delta_logs(base_log: List[dict], new_entries: List[dict]) -> List[dict]:
|
|
"""A naive merge providing deterministic replay semantics.
|
|
|
|
This is a placeholder and should be replaced with a robust CRDT-like
|
|
merge in a full implementation. For now, we simply append new entries that
|
|
are not duplicates of the base log.
|
|
"""
|
|
seen = {tuple(e.items()) for e in base_log}
|
|
merged = list(base_log)
|
|
for entry in new_entries:
|
|
key = tuple(entry.items())
|
|
if key not in seen:
|
|
merged.append(entry)
|
|
seen.add(key)
|
|
return merged
|
|
|
|
|
|
__all__ = ["merge_delta_logs"]
|