MCPcopy Create free account
hub / github.com/T0UGH/codex-self-evolution-plugin / _load

Function _load

src/codex_self_evolution/migrate.py:232–242  ·  view source on GitHub ↗
(path: Path)

Source from the content-addressed store, hash-verified

230 dict so callers can also re-render MEMORY.md / USER.md.
231 """
232 def _load(path: Path) -> dict[str, list[dict[str, Any]]]:
233 if not path.exists():
234 return {"user": [], "global": []}
235 try:
236 data = load_json(path)
237 except Exception: # noqa: BLE001 — corrupt files contribute nothing
238 return {"user": [], "global": []}
239 return {
240 "user": data.get("user", []) or [] if isinstance(data, dict) else [],
241 "global": data.get("global", []) or [] if isinstance(data, dict) else [],
242 }
243
244 source_memory = source_path / "memory" / "memory.json"
245 target_memory = target_path / "memory" / "memory.json"

Callers 1

_merge_memoryFunction · 0.85

Calls 1

load_jsonFunction · 0.85

Tested by

no test coverage detected