fix(packs): pack registry presets now load at query time#25
Merged
Conversation
bcli pack install stored registries/<profile>.json `endpoints` as a name→body object, but the runtime EndpointRegistry iterates `endpoints` as a JSON array. Pack-installed presets therefore never resolved at query time, and merging into an existing array-shaped registry (e.g. one produced by `bcli registry import`) raised InstallError. Install and uninstall now read/merge/filter `endpoints` as a list keyed by each entry's entity_set_name. Added a regression test that installs a preset and resolves it through the real registry loader (load_custom_from_file + resolve) — the path that was silently broken. Patch on top of 0.6.0.
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
Follow-up bug fix surfaced while building the Beautech bootstrap packs.
bcli pack installwroteregistries/<profile>.jsonendpointsas a name→body object, but the runtimeEndpointRegistry(src/bcli/registry/_registry.py:52) iteratesendpointsas a JSON array. Two consequences:bcli registry import— raisedInstallError: 'endpoints' must be an object(caught gracefully, no corruption, but presets didn't land).The runtime loader is the established contract, so the installer now conforms: install and uninstall read/merge/filter
endpointsas a list keyed by each entry'sentity_set_name.Changes
_installer.pyinstall: merge presets into theendpointsarray, replacing an entry with the sameentity_set_nameor appending._installer.pyuninstall: filter the array byentity_set_nameinstead of deleting dict keys.test_installed_preset_is_loadable_by_runtime_registry— installs a preset, then loads it through the real registry loader (EndpointRegistry.load_custom_from_file+.resolve). This is the path that was silently broken; the prior tests only round-tripped through the installer's own (wrong) dict shape.Test plan
uv run pytest— 947 passed, 5 skipped, 0 faileduv run ruff check src/ tests/— clean