refactor(core): centralize config, purify domain, and modernize LLM adapters#59
Merged
Conversation
Make the config loader the effective runtime authority for API and CLI entrypoints. Add typed API transport settings, route indexing compatibility through the central config path, and propagate resolved configuration into interface entrypoints instead of rebuilding it ad hoc.
Replace filesystem inspection in domain indexing rules with pure facts supplied by outer layers. Tighten port-facing typing across domain-adjacent modules so indexing and retrieval logic depend on structured inputs instead of concrete runtime state.
Tighten lazy-init adapters and infrastructure helpers so they remain type-safe under strict static checks. Normalize ancillary integration and contract tests around those runtime guards without changing product behavior.
Replace the prompt-centric LLM contract with a message-oriented port and move RAG context assembly into the application layer. Update adapters and contract coverage so model providers only translate canonical messages instead of owning retrieval-specific prompt construction.
Add OpenAI-compatible provider aliases at the composition boundary and forward injected base URLs and API keys into the shared OpenAI-family adapters. This keeps the port stable while widening support for OpenAI-style hosted and self-hosted model APIs.
Finish the test-suite cleanup by aligning package markers, removing stale lint configuration noise, and applying mechanical Ruff-driven normalization across remaining test support files. This keeps repo hygiene green without changing product behavior.
Update the explicit Starlette pin to a non-vulnerable 1.x release so the security job passes without weakening the audit gate. Regenerate the lockfile and revalidate the repo against Ruff, mypy, pytest, and the CI-equivalent pip-audit command.
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
src/andtests/pass current Ruff/mypy expectationsArchitecture
This PR consolidates several related modernization steps that were previously coupled by the same runtime seams:
Config architecture
BhodiConfignow owns API transport settings throughApiConfigDomain purity
IndexingTarget) instead of concrete path I/OLLM architecture
generate_with_contextis removed entirelyProvider-family direction
base_urlQuality posture
mypy src/ruff check tests/Testing
uv run ruff check src testsuv run mypy src/uv run pytestResults:
261 passedNotes