personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

apps/tests: isolate app test harnesses from installed checkout

Evict cached `apps`/`convey`/`think` modules at conftest import time so
app-scoped pytest runs exercise this worktree instead of whatever is
installed in the env. Surfaces a pre-existing stale-cache bug in
`update_entity` where a relationship write isn't followed by a cache
invalidation; fix it in the same commit so CI stays green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

+46 -2
+1
apps/entities/call.py
··· 342 342 relationship["description"] = description 343 343 relationship["updated_at"] = now_ms() 344 344 save_facet_relationship(facet, entity_id, relationship) 345 + clear_entity_loading_cache() 345 346 log_call_action( 346 347 facet=facet, 347 348 action="entity_update",
+37
apps/entities/tests/conftest.py
··· 15 15 if str(ROOT) not in sys.path: 16 16 sys.path.insert(0, str(ROOT)) 17 17 18 + for name, module in list(sys.modules.items()): 19 + if name.split(".", 1)[0] not in {"apps", "convey", "think"}: 20 + continue 21 + module_file = getattr(module, "__file__", None) 22 + if module_file and not Path(module_file).resolve().is_relative_to(ROOT): 23 + sys.modules.pop(name, None) 24 + 18 25 from apps.speakers.tests.conftest import speakers_env as _speakers_env 26 + from convey import create_app 27 + from tests._baseline_harness import copytree_tracked 19 28 from think.entities.journal import clear_journal_entity_cache 20 29 from think.entities.loading import clear_entity_loading_cache 21 30 from think.entities.observations import ( ··· 25 34 ) 26 35 from think.entities.relationships import clear_relationship_caches 27 36 from think.entities.saving import save_entities 37 + 38 + 39 + @pytest.fixture(autouse=True) 40 + def _skip_supervisor_check(monkeypatch): 41 + monkeypatch.setenv("SOL_SKIP_SUPERVISOR_CHECK", "1") 42 + 43 + 44 + @pytest.fixture 45 + def journal_copy(tmp_path, monkeypatch): 46 + src = Path(__file__).resolve().parents[3] / "tests" / "fixtures" / "journal" 47 + dst = tmp_path / "journal" 48 + copytree_tracked(src, dst) 49 + monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", str(dst.resolve())) 50 + clear_journal_entity_cache() 51 + clear_entity_loading_cache() 52 + clear_relationship_caches() 53 + clear_observation_cache() 54 + import think.utils 55 + 56 + think.utils._journal_path_cache = None 57 + return dst 58 + 59 + 60 + @pytest.fixture 61 + def client(journal_copy, monkeypatch): 62 + monkeypatch.setenv("_SOLSTONE_JOURNAL_OVERRIDE", str(journal_copy)) 63 + app = create_app(str(journal_copy)) 64 + return app.test_client() 28 65 29 66 30 67 @pytest.fixture
+8 -2
apps/transcripts/tests/conftest.py
··· 9 9 10 10 import pytest 11 11 12 - from convey import create_app 13 - 14 12 ROOT = Path(__file__).resolve().parents[3] 15 13 if str(ROOT) not in sys.path: 16 14 sys.path.insert(0, str(ROOT)) 17 15 16 + for name, module in list(sys.modules.items()): 17 + if name.split(".", 1)[0] not in {"apps", "convey", "think"}: 18 + continue 19 + module_file = getattr(module, "__file__", None) 20 + if module_file and not Path(module_file).resolve().is_relative_to(ROOT): 21 + sys.modules.pop(name, None) 22 + 23 + from convey import create_app 18 24 from tests._baseline_harness import copytree_tracked 19 25 20 26