Skip to content

Commit c31cf8e

Browse files
aeromomoclaude
andcommitted
refactor: split engram.py (793→425 lines) into 4 modules
Extract HTTP client (engram_http.py), LLM client (engram_llm.py), and utility functions (engram_utils.py) from monolithic engram.py. Update all imports in source and tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent a5cf249 commit c31cf8e

File tree

8 files changed

+412
-454
lines changed

8 files changed

+412
-454
lines changed

scripts/engram_auto.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ def _print_summary(
929929
if totals:
930930
# Show pending token counts per thread
931931
storage = EngramStorage(self.workspace)
932-
from claw_compactor.engram import _count_messages_tokens
932+
from claw_compactor.engram_utils import count_messages_tokens as _count_messages_tokens
933933
print("Thread pending tokens:")
934934
for tid in sorted(totals.keys()):
935935
pending = storage.read_pending(tid)
@@ -967,7 +967,7 @@ def print_status(workspace: Path, engram_cfg: Dict) -> None:
967967
pending = storage.read_pending(tid)
968968
obs = storage.read_observations(tid)
969969
ref = storage.read_reflection(tid)
970-
from claw_compactor.engram import _count_messages_tokens
970+
from claw_compactor.engram_utils import count_messages_tokens as _count_messages_tokens
971971
pt = _count_messages_tokens(pending)
972972
ot = estimate_tokens(obs)
973973
rt = estimate_tokens(ref)

scripts/lib/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import sys
55

66

7-
def main():
7+
def main() -> None:
88
"""Dispatch to mem_compress.py with rewritten arguments."""
99
from pathlib import Path
1010

0 commit comments

Comments
 (0)