refactor(llmrails): fix package ownership boundaries (8/9)#2130
Draft
Pouyanpi wants to merge 2 commits into
Draft
refactor(llmrails): fix package ownership boundaries (8/9)#2130Pouyanpi wants to merge 2 commits into
Pouyanpi wants to merge 2 commits into
Conversation
Deduplicate prompt/messages validation at the request helper boundary and remove the no-op verbose property now that LLMRails only needs a readable verbose attribute. Keep the HasVerbose protocol read-only so helpers can depend on either attribute or property implementations.
This was referenced Jul 2, 2026
This was referenced Jul 2, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
11 tasks
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.
Description
Moves extracted helpers into their final ownership packages and removes narrow boundary duplication.
Why
Package names should describe lifecycle and ownership rather than where code happened to originate in
llmrails.py.What Changed
rails.llm.runtimetorails.llm.colang_turns.embeddingwhile retaining startup config derivation under startup.LLMRails.verboseproperty while retaining the readable attribute contract.Review Guidance
This PR is the full behavior-preserving gate. Run and review every row in the LLMRails decomposition review matrix against the recorded #2122 baseline before accepting the final ownership boundary.
This is the intended final review point for package locations and ownership names. It contains the ownership moves first and a narrow cleanup second; semantic behavior follow-ups remain isolated in part 9.
This nine-part stack turns
LLMRailsinto a public compatibility shell while moving owned behavior into focused modules. Review each PR only against its parent. Parts 2-6 intentionally stage behavior-preserving extraction; part 7 consolidates shared type contracts and logger naming; part 8 establishes the final package ownership; part 9 contains the explicit semantic follow-ups.For parts 2-6, please distinguish stack-local correctness or compatibility problems from naming and placement concerns already resolved in parts 7-8. If an intermediate name or location is correct and mergeable at that point, prefer reviewing its final form in the resolving PR instead of requesting duplicate churn. Public API changes, behavior changes, import cycles, or an independently broken intermediate branch remain in scope wherever they appear. Much of the apparent added LOC is moved code plus focused tests; the corresponding implementation is removed or delegated from
llmrails.pyin the same PR.Stack Position
Part 8 of 9.
restack/llmrails-01-public-contract-testsdeveloprestack/llmrails-02-startuprestack/llmrails-01-public-contract-testsrestack/llmrails-03-runtime-conversationrestack/llmrails-02-startuprestack/llmrails-04-generationrestack/llmrails-03-runtime-conversationrestack/llmrails-05-streamingrestack/llmrails-04-generationrestack/llmrails-06-checks-finalrestack/llmrails-05-streamingrestack/llmrails-07-consistencyrestack/llmrails-06-checks-finalrestack/llmrails-08-boundary-ownershiprestack/llmrails-07-consistencyrestack/llmrails-09-followupsrestack/llmrails-08-boundary-ownershipVerification
AI Assistance
Checklist