MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _snapshot_from_journal

Function _snapshot_from_journal

openkb/mutation.py:371–384  ·  view source on GitHub ↗
(path: Path, data: dict)

Source from the content-addressed store, hash-verified

369
370
371def _snapshot_from_journal(path: Path, data: dict) -> MutationSnapshot:
372 snapshot = MutationSnapshot(
373 kb_dir=Path(data["kb_dir"]),
374 backup_dir=Path(data["backup_dir"]),
375 journal_path=path,
376 operation=data.get("operation", "mutation"),
377 details=data.get("details") or {},
378 )
379 snapshot.entries = {
380 Path(item["target"]): Path(item["backup"]) if item.get("backup") else None
381 for item in data.get("entries", [])
382 }
383 snapshot.attempts = int(data.get("attempts", 0) or 0)
384 return snapshot
385
386
387def recover_pending_journals(kb_dir: Path) -> list[str]:

Callers 1

recover_pending_journalsFunction · 0.85

Calls 2

MutationSnapshotClass · 0.85
getMethod · 0.45

Tested by

no test coverage detected