Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions loopx/chat_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
plan_managed_turn_acceptance,
)
from .control_plane.collaboration.source_chat_observation import (
CHAT_SESSION_SCHEMA_VERSION,
CHAT_TURN_SCHEMA_VERSION,
_opaque_id,
_read_json,
CHAT_SESSION_SCHEMA_VERSION as CHAT_SESSION_SCHEMA_VERSION,
CHAT_TURN_SCHEMA_VERSION as CHAT_TURN_SCHEMA_VERSION,
_opaque_id as _opaque_id,
_read_json as _read_json,
)
from .file_lock import exclusive_file_lock, try_exclusive_file_lock, write_json_atomic

Expand Down
40 changes: 40 additions & 0 deletions tests/test_antigravity_adapter_contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -497,3 +497,43 @@ def do_POST(self) -> None:
server.shutdown()
server.server_close()
thread.join(timeout=2)


def test_chat_store_reexports_preserve_caller_imports_and_mypy_contracts() -> None:
from loopx import chat_store
from loopx.control_plane.collaboration import source_chat_observation

for symbol in (
"CHAT_SESSION_SCHEMA_VERSION",
"CHAT_TURN_SCHEMA_VERSION",
"_opaque_id",
"_read_json",
):
assert getattr(chat_store, symbol) is getattr(source_chat_observation, symbol)

caller_paths = (
"loopx/chat/session_open.py",
"loopx/chat_runtime.py",
"loopx/chat/ingress.py",
"loopx/chat/event_cache.py",
"loopx/capabilities/native_chat/external_conversations.py",
"loopx/capabilities/native_chat/conversation_bindings.py",
"loopx/extensions/lark/owner_attention.py",
"loopx/extensions/lark/private_conversations.py",
"loopx/extensions/lark/private_delivery_discovery.py",
"loopx/extensions/lark/private_ingress.py",
"loopx/extensions/lark/private_mention_topics.py",
"loopx/extensions/lark/private_steward_triage.py",
"loopx/extensions/lark/steward_reports.py",
)
errors_by_file = _run_mypy_contract_probe(caller_paths)
for caller in caller_paths:
reexport_errors = [
err for err in errors_by_file[caller]
if 'Module "loopx.chat_store" does not explicitly export attribute' in err
]
assert reexport_errors == [], f"{caller} hit implicit re-export error: {reexport_errors}"
assert (
len(errors_by_file["loopx/chat/session_open.py"])
<= _CALLER_ERROR_CAPS["loopx/chat/session_open.py"]
)
Loading