Skip to content

fix(packs): pack registry presets now load at query time#25

Merged
igor-ctrl merged 1 commit into
mainfrom
fix/pack-registry-list-shape
May 27, 2026
Merged

fix(packs): pack registry presets now load at query time#25
igor-ctrl merged 1 commit into
mainfrom
fix/pack-registry-list-shape

Conversation

@igor-ctrl
Copy link
Copy Markdown
Owner

Summary

Follow-up bug fix surfaced while building the Beautech bootstrap packs.

bcli pack install wrote registries/<profile>.json endpoints as a name→body object, but the runtime EndpointRegistry (src/bcli/registry/_registry.py:52) iterates endpoints as a JSON array. Two consequences:

  1. Pack-installed registry presets never resolved at query time (the loader saw an empty/incompatible structure).
  2. Installing a pack on top of an existing array-shaped registry — e.g. one produced by bcli registry import — raised InstallError: '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 endpoints as a list keyed by each entry's entity_set_name.

Changes

  • _installer.py install: merge presets into the endpoints array, replacing an entry with the same entity_set_name or appending.
  • _installer.py uninstall: filter the array by entity_set_name instead of deleting dict keys.
  • New regression test 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.
  • Updated the three existing installer-test assertions from dict-shape to array-shape.
  • Patch bump 0.6.0 → 0.6.1.

Test plan

  • uv run pytest947 passed, 5 skipped, 0 failed
  • uv run ruff check src/ tests/ — clean
  • New round-trip test fails on the old dict-writing code, passes now
  • Conflict-detection + ledger paths unchanged (ledger still keys by preset name)

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.
@igor-ctrl igor-ctrl merged commit a0c3331 into main May 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant