Remove _diff marker: use self-describing jay_diff protocol

Server (network.py): send every record in diff mode starting from
prev={}, including the first — fixes history drop on new client connect.

Collect (collect.py): remove payload["_diff"] = True from live broadcast.

GUI client (gui_client.py): always call jay_merge_full in diff mode;
drop the _diff key check that gated reconstruction.

CLI client (client.py): fix `args.diff or True` guard that made --diff
irrelevant.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-26 16:08:33 +02:00
co-authored by Claude Sonnet 4.6
parent a4ce702ee4
commit ca5b284e9a
4 changed files with 6 additions and 19 deletions
+4 -8
View File
@@ -31,16 +31,12 @@ def _accept_loop(
records = in_mem
try:
if store_ref.get("diff_mode") and len(records) > 1:
lines = [json.dumps(records[0], default=str) + "\n"]
prev = records[0]
for record in records[1:]:
if store_ref.get("diff_mode"):
prev: dict = {}
for record in records:
diff = jay_diff_full(prev, record, combine_upd_add=True)
diff["_diff"] = True
lines.append(json.dumps(diff, default=str) + "\n")
prev = record
for line in lines:
conn.sendall(line.encode())
conn.sendall((json.dumps(diff, default=str) + "\n").encode())
else:
for record in records:
conn.sendall((json.dumps(record, default=str) + "\n").encode())