Fix custom domain resolution in load_domain (#30)#52
Open
ecsricktorzynski wants to merge 1 commit into
Open
Conversation
load_domain() only searched the bundled domains directory, so domains saved to ~/.create-context-graph/custom-domains/ failed with 'Domain not found' despite appearing in list_available_domains(). Resolution now mirrors the listing logic (bundled + custom, with a domain.id fallback), and load_domain() delegates to load_domain_from_path() to reuse the base merge logic. Adds regression tests asserting every listed domain loads.
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.
Closes #30.
Problem
list_available_domains()scans both the bundled domains directory and~/.create-context-graph/custom-domains/, butload_domain()only searched the bundled directory. Saved custom domains therefore appeared in the 'Available domains' list yet failed to load with 'Domain not found' — affecting both the--domainCLI flag and selecting a saved custom domain in the wizard.Fix
Added
_find_domain_path(), which resolves a domain id against bundled then custom directories, with a fallback that matches the YAML's internaldomain.idwhen a saved file's stem has drifted.load_domain()now delegates to the existingload_domain_from_path()so the base-inheritance merge isn't duplicated.Tests
Added
TestLoadCustomDomainResolution(5 tests), including one asserting every domain inlist_available_domains()is loadable. No regressions across test_ontology.py and test_custom_domain.py.