Stop bypassing the knowpro.interfaces aggregator - #306
Open
Bernhard Merkle (bmerkle) wants to merge 1 commit into
Open
Stop bypassing the knowpro.interfaces aggregator#306Bernhard Merkle (bmerkle) wants to merge 1 commit into
Bernhard Merkle (bmerkle) wants to merge 1 commit into
Conversation
interfaces.py explicitly re-exports interfaces_core/interfaces_indexes/ interfaces_search/interfaces_serialization/interfaces_storage via __all__ (exempted from AGENTS.md's "no re-export" rule by its own exception clause), but 4 files partially imported some symbols through it and others directly from the defining submodule: - conversation_base.py: TextLocation (from interfaces_core) - add_messages.py: IKnowledgeExtractor, IMessage, MessageOrdinal, TextLocation (from interfaces_core) - storage/sqlite/provider.py: ChunkFailure (from interfaces_storage) - podcast_ingest.py: AddMessagesResult (from interfaces_core) Investigated and ruled out both plausible justifications: none of the interfaces_*.py submodules import anything from these 4 files (no circular-import risk), and every bypassed symbol is confirmed present in the relevant submodule's __all__ (nothing missing from the aggregator). Git history shows the bypass lines were added months after the aggregator existed, across unrelated feature commits with no import-style rationale -- incidental, not deliberate. Merges each bypassed import into the existing (or a new) `from .interfaces import (...)` block. Found via a whole-project import-style scan, tracked in microsoft#298.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes import style by routing several knowpro interface symbol imports through the knowpro.interfaces aggregator module, eliminating “bypass” imports that reached directly into interfaces_core / interfaces_storage.
Changes:
- Consolidate
ChunkFailure,ConversationMetadata, andSTATUS_INGESTEDimports in the SQLite provider to come fromknowpro.interfaces. - Consolidate
AddMessagesResultandDatetimeimports in podcast ingest to come fromknowpro.interfaces. - Consolidate
TextLocationand other interface symbols inknowprocore modules (conversation_base.py,add_messages.py) to come fromknowpro.interfaces.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/typeagent/storage/sqlite/provider.py | Merges ChunkFailure into the existing knowpro.interfaces import. |
| src/typeagent/podcasts/podcast_ingest.py | Imports AddMessagesResult via the knowpro.interfaces aggregator instead of interfaces_core. |
| src/typeagent/knowpro/conversation_base.py | Removes direct interfaces_core import of TextLocation, using the aggregator import block instead. |
| src/typeagent/knowpro/add_messages.py | Consolidates several interface-symbol imports into a single from .interfaces import (...) block. |
Collaborator
Author
|
robgruen would you mind taking a look at this one when you get a chance? Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
interfaces.pyexplicitly re-exportsinterfaces_core/interfaces_indexes/interfaces_search/interfaces_serialization/interfaces_storagevia__all__(exempted from AGENTS.md's "no re-export" rule by its own exception clause), but 4 files partially imported some symbols through it and others directly from the defining submodule:conversation_base.py:TextLocation(frominterfaces_core)add_messages.py:IKnowledgeExtractor,IMessage,MessageOrdinal,TextLocation(frominterfaces_core)storage/sqlite/provider.py:ChunkFailure(frominterfaces_storage)podcast_ingest.py:AddMessagesResult(frominterfaces_core)Investigated and ruled out both plausible justifications (details in #298):
interfaces_*.pysubmodules import anything from these 4 files.__all__.Git history shows the bypass lines were added months after the aggregator existed (2025-12-31), across unrelated feature commits (streaming API, batching/pipeline overlap) with no import-style rationale — incidental, not deliberate.
Merges each bypassed import into the existing (or a new)
from .interfaces import (...)block.Found via a whole-project import-style scan, tracked in #298.
Test plan
make(format, check on 3.12/3.14, test, build) — 0 pyright errors, 737 passed / 12 skipped, wheel builds