Coverage for core / __init__.py: 100.0%
7 statements
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-12 04:49 +0000
« prev ^ index » next coverage.py v7.14.0, created at 2026-05-12 04:49 +0000
1"""
2Core infrastructure modules for performance optimization.
4Provides:
5- config_cache: Cached config loading (eliminates repeated file I/O)
6- http_pool: Connection-pooled HTTP sessions
7- event_loop: Singleton event loop management
8- session_cache: TTL-based session caching for global dicts
9- platform: OS platform layer (ServiceRegistry, EventBus, AppRegistry, etc.)
10"""
12# Install transformers `_LazyModule.__getattr__` recursion guard FIRST.
13# Any `from core.X import Y` path triggers this package init, so the guard
14# is in place before any submodule pulls in langchain/transformers. Mirrors
15# the install at hart_intelligence_entry.py:80-209 (commit a6d2dca) so
16# entry paths that don't go through HIE are still protected. Idempotent.
17from core import _transformers_lazy_guard # noqa: F401
19from core.config_cache import get_config, get_secret
20from core.http_pool import get_http_session, pooled_get, pooled_post
21from core.event_loop import get_or_create_event_loop
22from core.session_cache import TTLCache
23from core.file_cache import cached_json_load, cached_json_save, invalidate_file_cache
24from core.platform_paths import get_data_dir, get_db_path, get_db_dir, get_agent_data_dir