22
33from __future__ import annotations
44
5+ from pathlib import Path
6+
57import pytest
68
79from config .settings import load_app_config
810from core .memory_manager import MemoryManager
911from models .memory import SemanticNode , WorkingMemoryItem
1012
1113
12- def _bootstrap_manager (monkeypatch , tmp_path ) -> MemoryManager :
14+ def _bootstrap_manager (
15+ monkeypatch : pytest .MonkeyPatch ,
16+ tmp_path : Path ,
17+ ) -> MemoryManager :
1318 monkeypatch .setenv ("DRM_MEMORY_LOG_PATH" , str (tmp_path / "revisions.jsonl" ))
1419 monkeypatch .setattr ("core.memory_manager.redis_module" , None )
1520 monkeypatch .setattr ("core.memory_manager.chromadb_module" , None )
@@ -18,7 +23,10 @@ def _bootstrap_manager(monkeypatch, tmp_path) -> MemoryManager:
1823 return MemoryManager (config )
1924
2025
21- def test_link_semantic_nodes_updates_relations (monkeypatch , tmp_path ) -> None :
26+ def test_link_semantic_nodes_updates_relations (
27+ monkeypatch : pytest .MonkeyPatch ,
28+ tmp_path : Path ,
29+ ) -> None :
2230 manager = _bootstrap_manager (monkeypatch , tmp_path )
2331
2432 node_a = SemanticNode (id = "concept:a" , label = "Alpha" , definition = "Alpha concept" )
@@ -37,7 +45,10 @@ def test_link_semantic_nodes_updates_relations(monkeypatch, tmp_path) -> None:
3745 assert forward [0 ][1 ] == pytest .approx (0.75 , abs = 1e-6 )
3846
3947
40- def test_list_semantic_nodes_returns_ordered (monkeypatch , tmp_path ) -> None :
48+ def test_list_semantic_nodes_returns_ordered (
49+ monkeypatch : pytest .MonkeyPatch ,
50+ tmp_path : Path ,
51+ ) -> None :
4152 manager = _bootstrap_manager (monkeypatch , tmp_path )
4253
4354 first = SemanticNode (id = "concept:old" , label = "Old" , definition = "Old concept" )
@@ -53,7 +64,10 @@ def test_list_semantic_nodes_returns_ordered(monkeypatch, tmp_path) -> None:
5364 assert [node .id for node in limited ] == [second .id ]
5465
5566
56- def test_apply_drift_mitigation_prunes_working (monkeypatch , tmp_path ) -> None :
67+ def test_apply_drift_mitigation_prunes_working (
68+ monkeypatch : pytest .MonkeyPatch ,
69+ tmp_path : Path ,
70+ ) -> None :
5771 manager = _bootstrap_manager (monkeypatch , tmp_path )
5872
5973 for index in range (3 ):
0 commit comments