spec-kit icon indicating copy to clipboard operation
spec-kit copied to clipboard

[Bug]: `bundle install --refresh` and `bundle update` reset priorities set with `set-priority`

Open kartsan03 opened this issue 3 weeks ago • 0 comments

Bug Description

specify bundle install --refresh and specify bundle update reset a bundle component's priority to the value the bundle declares. A priority the user set with specify preset set-priority or specify extension set-priority is lost, so the order in which presets and extensions resolve changes back without any message.

docs/bundles/cli.md says the opposite: "Refresh reapplies bundle-owned components through their primitive update paths, preserving primitive-level overrides such as preset priority." The refresh goes through a forced reinstall, and _PresetKindManager._do_install and _ExtensionKindManager._do_install in src/specify_cli/bundles/primitives.py pass the bundle's declared priority (or the default of 10) to it without reading the one already in the registry.

Steps to Reproduce

A local bundle that requires the bundled bug extension and lean preset:

mkdir -p team && cat > team/bundle.yml <<'EOF'
schema_version: "1.0"
bundle:
  id: team
  name: Team
  version: 1.0.0
  description: Priority repro
  author: QA
  license: MIT
  role: developer
requires:
  speckit_version: ">=0.9.0"
provides:
  extensions:
    - id: bug
      version: 1.0.2
  presets:
    - id: lean
      version: 1.0.0
      priority: 10
      strategy: replace
EOF
mkdir project && cd project
specify init --here --integration copilot --ignore-agent-tools --non-interactive
specify bundle install ../team --offline
specify preset set-priority lean 3
specify extension set-priority bug 4
specify bundle install ../team --offline --refresh

Expected Behavior

After the refresh, .specify/presets/.registry still records lean at priority 3 and .specify/extensions/.registry records bug at 4.

Actual Behavior

Every command exits 0. The registries show:

After lean (preset) bug (extension)
bundle install 10 10
set-priority 3 4
bundle install --refresh 10 10

bundle update from a catalog resets them the same way.

Specify CLI Version

1.3.3.dev0 (main at c4384940)

AI Agent

Not applicable (bundle commands)

Operating System

Debian 12 (Linux 6.17)

Python Version

3.13

Error Logs

None; every command succeeds.

kartsan03 avatar Nov 08 '26 19:11 kartsan03