feat(core): implement Plan #62 efficiency, deduplication, caching & hook optimizations
This commit is contained in:
1 parent
d4b7502501
commit
9b587d6351
20 files changed
+176
-195
No files matched your search
@@ -24,7 +24,7 @@ import time
|
||||
from pathlib import Path
|
||||
from typing import Any, Iterable
|
||||
|
||||
from hyperstitionstud_io.config import load_workspace_config
|
||||
from hyperstitionstud_io.config import load_json_cached, load_workspace_config
|
||||
|
||||
SCHEMA_VERSION = 1
|
||||
|
||||
@@ -100,7 +100,7 @@ def load_ledger(path: Path) -> dict[str, Any]:
|
||||
if not path.exists():
|
||||
return {"version": SCHEMA_VERSION, "sources": []}
|
||||
try:
|
||||
data = json.loads(path.read_text(encoding="utf-8"))
|
||||
data = load_json_cached(path, copy_result=True)
|
||||
except (json.JSONDecodeError, OSError) as exc:
|
||||
raise SystemExit(f"error: ledger at {path} is unreadable ({exc}); run `reset` to start over")
|
||||
if not isinstance(data, dict) or not isinstance(data.get("sources"), list):
|
||||
|
||||
Reference in new issue
Block a user