MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / diff_record

Function diff_record

examples/skills/data-collector/patterns.py:103–107  ·  view source on GitHub ↗
(old: dict | None, new: dict, watch: list[str])

Source from the content-addressed store, hash-verified

101
102# --- 6. change detection: emit only meaningful changes (powers monitoring/alerts)
103def diff_record(old: dict | None, new: dict, watch: list[str]) -> dict:
104 if old is None:
105 return {"type": "new", "fields": {f: new.get(f) for f in watch}}
106 changed = {f: {"from": old.get(f), "to": new.get(f)} for f in watch if old.get(f) != new.get(f)}
107 return {"type": "changed", "fields": changed} if changed else {"type": "unchanged"}
108
109
110# ---------------------------------------------------------------------------

Callers 1

patterns.pyFile · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected