feat(extensions,presets): add priority-based resolution ordering#1855
feat(extensions,presets): add priority-based resolution ordering#1855mbachorik wants to merge 7 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a priority field to extensions (and extends preset support) so resolution can be ordered deterministically, with lower numbers taking precedence, and exposes this via CLI commands and outputs.
Changes:
- Add priority-aware ordering to
ExtensionRegistryand use it in preset template resolution for extensions. - Add CLI support for setting priority (
extension add --priority,extension set-priority,preset set-priority) and display priority in list/info. - Add tests for priority behavior and backwards compatibility defaults (priority=10).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds priority persistence and ExtensionRegistry.list_by_priority() for ordering. |
src/specify_cli/presets.py |
Uses extension registry priority ordering during extension template resolution; adds preset registry update helper. |
src/specify_cli/__init__.py |
Adds CLI options/commands to set/display priority for extensions and presets; preserves priority on extension update. |
tests/test_extensions.py |
Adds unit + CLI tests for extension priority ordering, persistence, and legacy defaults. |
tests/test_presets.py |
Updates resolution tests to register extensions in registry; adds preset set-priority + legacy priority tests. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field and CLI behaviors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
d8ec7d3 to
0f94361
Compare
0f94361 to
598f39b
Compare
There was a problem hiding this comment.
Pull request overview
Adds a priority-based ordering model (lower number = higher precedence, default 10) across extensions and presets to make template/command resolution deterministic, with CLI support to view and modify priority and tests/docs updates.
Changes:
- Introduces
prioritymetadata andlist_by_priority()for extensions (and enhances preset sorting determinism/back-compat). - Adds CLI support for setting/displaying priority (
extension add --priority,extension set-priority,preset set-priority, priority shown in info/list). - Updates preset template resolution to iterate extensions by registry priority rather than directory name order; expands tests and RFC docs accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds extension list_by_priority() and persists priority during install/listing. |
src/specify_cli/presets.py |
Adds preset registry update(), strengthens list_by_priority() ordering, and resolves extension templates by extension priority. |
src/specify_cli/__init__.py |
Adds/updates CLI commands and output to set/show priority; preserves priority on extension update. |
tests/test_extensions.py |
Adds coverage for extension priority ordering, CLI integration, and legacy/back-compat behavior. |
tests/test_presets.py |
Updates resolver tests for new extension source attribution and adds tests for preset set-priority + legacy priority behavior. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field, CLI flags/commands, and updated list output examples. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
598f39b to
13a78ae
Compare
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering to extension and preset resolution to make overrides deterministic across installs, aligning extension behavior with the existing preset priority model and exposing priority controls via the CLI.
Changes:
- Introduces
prioritysupport for extensions (registry sorting + install/add/update preservation + CLI display/commands). - Extends preset tooling with
preset set-priority, priority display inpreset info, and backwards-compatibility handling for legacy entries. - Updates template resolution to iterate extensions/presets by priority (lower number = higher precedence) and updates RFC docs/tests accordingly.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds priority-aware sorting (list_by_priority) and persists/returns priority during installs and listing. |
src/specify_cli/presets.py |
Adds registry update helper, makes preset ordering deterministic, validates priority on install, and resolves extension templates via registry priority order. |
src/specify_cli/__init__.py |
Adds/validates --priority for extension add, adds extension set-priority and preset set-priority, and displays priority in list/info outputs. |
tests/test_extensions.py |
Adds coverage for extension priority ordering, CLI integration, and legacy/compat behavior. |
tests/test_presets.py |
Updates resolver tests to register extensions in the registry and adds tests for preset set-priority + legacy preset behavior. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field and CLI options/commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds priority-based precedence for extension and preset resolution (lower number = higher precedence) to make template selection deterministic across installs, and exposes priority management via new/updated CLI commands.
Changes:
- Introduces
prioritymetadata for extensions and presets, withlist_by_priority()sorting (priority, then ID) and defaults for legacy entries. - Adds CLI support to set priority (
extension set-priority,preset set-priority) and display priority inlist/info. - Updates resolver logic/tests/docs to use priority ordering and ensure backwards compatibility behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds ExtensionRegistry.list_by_priority(), persists/validates priority during install, and includes priority in installed listing. |
src/specify_cli/presets.py |
Adds PresetRegistry.update(), makes preset ordering deterministic with deep-copied metadata, and uses extension registry priority ordering during template resolution. |
src/specify_cli/__init__.py |
Adds CLI validation and new set-priority commands; displays priority in extension list/info and preset info. |
tests/test_extensions.py |
Adds unit/CLI/back-compat coverage for extension priority behavior. |
tests/test_presets.py |
Updates resolver tests to register extensions in the registry; adds preset set-priority + back-compat tests. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field, CLI options, and expected output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. BTW you rock!
will check them tonight or tomorrow evening . |
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering to extension and preset resolution so overrides are deterministic when multiple sources provide the same templates/commands, while remaining backwards compatible via a default priority of 10 (lower number = higher precedence).
Changes:
- Introduces
priorityto extension/preset registries pluslist_by_priority()for deterministic ordering (with tie-break by ID). - Adds CLI support to set priority at install time and adjust it later (
extension add --priority,extension set-priority,preset set-priority) and displays priority ininfo/list. - Updates PresetResolver to resolve extension-provided templates using registry priority ordering (with a directory-scan fallback if registry is missing/corrupt) and adds/updates tests + RFC docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds list_by_priority() and persists/validates priority through installs; includes priority in list_installed(). |
src/specify_cli/presets.py |
Adds PresetRegistry.update(), deep-copied deterministic list_by_priority(), validates preset priority on install, and resolves extension templates by extension priority. |
src/specify_cli/__init__.py |
Adds CLI flags/commands for setting priority and prints priority in extension list/info and preset info; preserves priority on extension update. |
tests/test_extensions.py |
Adds coverage for extension priority ordering, CLI integration, and backwards compatibility defaults. |
tests/test_presets.py |
Updates resolver source attribution expectations and adds tests for preset set-priority + legacy priority defaults. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the priority field and updates CLI usage/output examples accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds a priority-based, deterministic resolution order for installed extensions and presets, enabling predictable overrides when multiple providers supply the same templates (lower priority = higher precedence; default 10), while maintaining backward compatibility for legacy registry entries.
Changes:
- Introduces
prioritymetadata support andlist_by_priority()ordering for extensions (and tightens deterministic ordering via tie-break by ID). - Updates preset template resolution to prefer extensions in priority order (with a fallback to directory scanning when the extension registry is missing/empty).
- Adds CLI support and tests for setting/viewing priority for both extensions and presets, plus backward-compat tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tests/test_presets.py |
Registers extensions in the extension registry during resolver tests; adds preset set-priority and legacy-priority compatibility tests. |
tests/test_extensions.py |
Adds comprehensive unit/CLI/back-compat tests for extension priority behavior. |
src/specify_cli/presets.py |
Adds PresetRegistry.update(), makes list_by_priority() deterministic/deep-copied, and resolves extension templates using extension priority ordering with fallback behavior. |
src/specify_cli/extensions.py |
Adds ExtensionRegistry.list_by_priority() and persists/validates priority through extension installs and listing. |
src/specify_cli/__init__.py |
Adds CLI validation/output for priority, plus extension set-priority and preset set-priority commands. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field and updates CLI examples (but see doc/CLI option mismatch comment). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering (lower number = higher precedence, default 10) across extension/preset metadata and CLI, and updates template resolution to respect extension priority (with back-compat defaults).
Changes:
- Add
prioritysupport to extension installs/registry, plusExtensionRegistry.list_by_priority()and CLI surfaces (--priority,set-priority, list/info output). - Add preset
set-prioritycommand and show priority inpreset info; add preset registry update support. - Update
PresetResolverto resolve extension templates using registry priority ordering with a directory-scan fallback.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_presets.py | Updates resolver source attribution expectations and adds coverage for preset set-priority + legacy priority defaults. |
| tests/test_extensions.py | Adds coverage for extension priority ordering, CLI integration, and legacy entries defaulting to priority 10. |
| src/specify_cli/presets.py | Adds PresetRegistry.update(), enhances list_by_priority() determinism, and updates extension template resolution to use priority ordering. |
| src/specify_cli/extensions.py | Adds ExtensionRegistry.list_by_priority() and persists/validates priority during installs and listing. |
| src/specify_cli/init.py | Wires priority into CLI (extension add --priority, extension set-priority, preset set-priority) and displays priority in list/info commands. |
| extensions/RFC-EXTENSION-SYSTEM.md | Documents the new priority field, CLI flags/commands, and updated list output format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering to extension and preset resolution so that lower numeric priority values take precedence (default 10), and exposes priority management via CLI commands and output.
Changes:
- Introduces
priorityinto extension registry/installation flows and addsExtensionRegistry.list_by_priority(). - Updates
PresetResolverto resolve extension templates using registry priority ordering (with a directory-scan fallback). - Adds
set-prioritycommands and priority display for both extensions and presets, plus tests and RFC updates.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds priority-aware listing and persists/validates priority during extension installs. |
src/specify_cli/presets.py |
Adds preset registry update, deep-copied deterministic priority ordering, and uses extension priority ordering in resolution. |
src/specify_cli/__init__.py |
Adds CLI options/commands (--priority, set-priority) and displays priority in list/info outputs; preserves priority on extension update. |
tests/test_extensions.py |
Adds coverage for extension priority ordering, install defaults, CLI integration, and back-compat behavior. |
tests/test_presets.py |
Updates extension source attribution expectations and adds preset set-priority + back-compat tests. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority registry field, CLI output, and set-priority usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering (lower number = higher precedence, default 10) across extensions and presets to make template resolution deterministic and user-configurable, while maintaining backward compatibility for existing installs.
Changes:
- Introduces priority support for extensions: registry ordering, CLI
--priority,set-priority, and priority display in list/info. - Extends presets with
set-priority, shows priority inpreset info, and uses extension priority ordering during preset template resolution (with a directory-scan fallback). - Adds/updates tests for priority ordering and backward compatibility; updates the extension system RFC to document priority behavior and CLI output.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_presets.py | Updates resolver expectations to include extension version in source and adds preset set-priority + legacy-priority tests. |
| tests/test_extensions.py | Adds extension priority tests (registry ordering, install/update behavior, CLI integration, legacy entries). |
| src/specify_cli/presets.py | Adds PresetRegistry.update(), makes preset ordering deterministic, validates priority on install, and resolves extension templates via registry priority with fallback scanning. |
| src/specify_cli/extensions.py | Adds ExtensionRegistry.list_by_priority(), adds priority support to installs, and includes priority in list_installed(). |
| src/specify_cli/init.py | Adds priority validation, new preset set-priority / extension set-priority commands, and displays priority in relevant CLI outputs. |
| extensions/RFC-EXTENSION-SYSTEM.md | Documents the new priority field, CLI output changes, and new/updated extension CLI flags/commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Add priority field to extension and preset registries for deterministic template resolution when multiple sources provide the same template. Extensions: - Add `list_by_priority()` method to ExtensionRegistry - Add `--priority` option to `extension add` command - Add `extension set-priority` command - Show priority in `extension list` and `extension info` - Preserve priority during `extension update` - Update RFC documentation Presets: - Add `preset set-priority` command - Show priority in `preset info` output - Use priority ordering in PresetResolver for extensions Both systems: - Lower priority number = higher precedence (default: 10) - Backwards compatible with legacy entries (missing priority defaults to 10) - Comprehensive test coverage including backwards compatibility Closes github#1845 Closes github#1854 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- list_by_priority(): add secondary sort by ID for deterministic ordering, return deep copies to prevent mutation - install_from_directory/zip: validate priority >= 1 early - extension add CLI: validate --priority >= 1 before install - PresetRegistry.update(): preserve installed_at timestamp - Test assertions: use exact source string instead of substring match Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- PresetResolver: add fallback to directory scanning when registry is empty/corrupted for robustness and backwards compatibility - PresetRegistry.update(): add guard to prevent injecting installed_at when absent in existing entry (mirrors ExtensionRegistry behavior) - RFC: update extension list example to match actual CLI output format Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
bde0456 to
e5b1a1a
Compare
- Restore defensive code in list_by_priority() with .get() and isinstance check - Restore detailed --from URL and --dev option descriptions in RFC Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add .get() and isinstance check for corrupted/empty registry - Move copy import to module level (remove local import) - Matches defensive pattern used in extensions.py Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds deterministic, priority-based resolution across extensions and presets, enabling explicit override ordering while remaining compatible with existing registries via a default priority of 10.
Changes:
- Introduces
prioritymetadata for extensions/presets and sorts resolution order by(priority, id)(lower number = higher precedence). - Adds CLI support to set/view priorities (
extension add --priority,extension set-priority,preset set-priority) and updates info/list output. - Updates template resolution to use extension registry ordering, with a fallback scan when the registry is empty/corrupted, plus adds/updates tests and RFC docs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_presets.py | Updates resolver tests to register extensions in the registry and asserts versioned extension source strings; adds preset set-priority + legacy priority tests. |
| tests/test_extensions.py | Adds coverage for extension priority sorting, install/update behavior, CLI --priority, set-priority, and legacy entries defaulting to priority 10. |
| src/specify_cli/presets.py | Adds PresetRegistry.update(), deep-copied deterministic list_by_priority(), validates install priority, and resolves extension templates via registry priority ordering (with fallback scan). |
| src/specify_cli/extensions.py | Adds ExtensionRegistry.list_by_priority(), adds/validates priority during installs, plumbs priority through install/update/listing metadata. |
| src/specify_cli/init.py | Adds CLI validation and commands/options for setting/displaying priority on presets/extensions; preserves priority on extension update; prints priority in list/info. |
| extensions/RFC-EXTENSION-SYSTEM.md | Documents the new priority field, updated extension list output, --priority, and set-priority usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Adds priority-based resolution ordering to extensions and presets so template/command resolution is deterministic and user-controllable, while keeping backward compatibility via default priority 10.
Changes:
- Introduces
prioritymetadata for extensions/presets with lower numbers taking precedence, plus deterministic tie-breaking. - Adds CLI support to set/view priority (
--priorityon add;set-prioritycommands; info/list output updates). - Updates resolver logic to use registry priority ordering (with a fallback directory scan when the registry is missing/empty).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds ExtensionRegistry.list_by_priority() and persists/returns priority in install/list flows. |
src/specify_cli/presets.py |
Adds preset registry update semantics, priority-aware listing, and uses extension registry priority ordering during resolution/attribution. |
src/specify_cli/__init__.py |
Adds CLI flags/commands for setting priority and displays priority in list/info outputs; preserves priority on extension update. |
tests/test_extensions.py |
Adds unit + CLI tests for extension priority ordering, storage, update preservation, and legacy behavior. |
tests/test_presets.py |
Updates/extends tests to register extensions for resolver tests, assert versioned source strings, and adds preset set-priority + legacy priority tests. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents the new priority field, updated list output example, and new CLI options/commands. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback ;)
- Rename _normalize_priority to normalize_priority (public API) - Add comprehensive tests for normalize_priority function (9 tests) - Filter non-dict metadata entries in list_by_priority() methods - Fix extension priority resolution to merge registered and unregistered extensions into unified sorted list (unregistered get implicit priority 10) - Add tests for extension priority resolution ordering (4 tests) The key fix ensures unregistered extensions with implicit priority 10 correctly beat registered extensions with priority > 10, and vice versa. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
still working on it - copilot is serving me it 1-by-1, to have more fun |
There was a problem hiding this comment.
Pull request overview
Adds priority-based ordering to extension and preset resolution so conflicts resolve deterministically (lower number = higher precedence), while keeping legacy installs working via a default priority of 10.
Changes:
- Introduces priority normalization +
list_by_priority()for extensions/presets and uses it in template resolution (including fallback handling for unregistered/corrupted registry cases). - Adds CLI support to set/display priority (
extension add --priority,extension set-priority,preset set-priority, plus info/list output updates). - Updates tests and RFC documentation to cover/display the new behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/extensions.py |
Adds priority normalization and registry ordering; persists priority on install and includes it in listing metadata. |
src/specify_cli/presets.py |
Adds preset registry update semantics, priority sorting with normalization, and priority-aware extension template resolution + source attribution. |
src/specify_cli/__init__.py |
Wires CLI options/commands for setting priority and printing it in info/list output; validates priority inputs. |
tests/test_extensions.py |
Adds unit/CLI/back-compat coverage for extension priority behavior (including normalization). |
tests/test_presets.py |
Extends resolver tests for extension ordering/attribution and adds preset set-priority + back-compat coverage. |
extensions/RFC-EXTENSION-SYSTEM.md |
Documents priority field and updates CLI examples/options accordingly. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Extract _get_all_extensions_by_priority() helper in PresetResolver to eliminate duplicated extension list construction - Add priority=10 assertion to test_legacy_extension_without_priority_field - Add priority=10 assertion to test_legacy_preset_without_priority_field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
@mnriem sorry, mis-clicked on you (to re-request review). still playing cat-mouse with copilot ... |
There was a problem hiding this comment.
Pull request overview
Adds deterministic, priority-based resolution ordering across extensions and presets, aligning template resolution behavior and exposing priority controls via CLI and docs.
Changes:
- Introduces
priorityhandling and deterministiclist_by_priority()ordering (default 10; lower wins; ties alphabetical) for extensions and presets. - Updates
PresetResolverto resolve extension-provided templates using priority ordering and improved source attribution. - Adds CLI support for setting/viewing priorities (
--priorityon add;set-prioritycommands) and updates RFC + tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_presets.py | Adds coverage for preset priority behavior, extension-template resolution ordering, and new preset set-priority command. |
| tests/test_extensions.py | Adds unit tests for normalize_priority, extension registry priority ordering, CLI integration, and backwards-compat cases. |
| src/specify_cli/presets.py | Adds preset registry update semantics, priority-sorted listing with normalization, and priority-aware extension template resolution. |
| src/specify_cli/extensions.py | Adds normalize_priority, ExtensionRegistry.list_by_priority(), and persists/returns priority in install & listing flows. |
| src/specify_cli/init.py | Adds/updates CLI commands/options to set/display priority for presets/extensions and preserves priority during extension update. |
| extensions/RFC-EXTENSION-SYSTEM.md | Documents the new priority field, updated extension list/add output/options, and set-priority usage. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
|
|
||
| console.print() | ||
| console.print("[green]✓ Installed[/green]") | ||
| priority = metadata.get("priority", 10) | ||
| console.print(f"[dim]Priority:[/dim] {priority}") |
| "name": manifest.name, | ||
| "version": metadata.get("version", "unknown"), | ||
| "description": manifest.description, | ||
| "enabled": metadata.get("enabled", True), | ||
| "priority": metadata.get("priority", 10), |
| console.print("\n [green]Status: installed[/green]") | ||
| # Get priority from registry | ||
| pack_metadata = manager.registry.get(pack_id) | ||
| priority = pack_metadata.get("priority", 10) if pack_metadata else 10 |
| metadata = manager.registry.get(pack_id) | ||
| if metadata is None: | ||
| console.print(f"[red]Error:[/red] Preset '{pack_id}' not found in registry (corrupted state)") | ||
| raise typer.Exit(1) |
| existing = self.data["presets"][pack_id] | ||
| # Merge: existing fields preserved, new fields override | ||
| merged = {**existing, **updates} | ||
| # Always preserve original installed_at based on key existence, not truthiness, | ||
| # to handle cases where the field exists but may be falsy (legacy/corruption) |
| if is_installed: | ||
| console.print("[green]✓ Installed[/green]") | ||
| metadata = manager.registry.get(ext_info['id']) | ||
| priority = metadata.get("priority", 10) if metadata else 10 |
| # Get current metadata | ||
| metadata = manager.registry.get(extension_id) | ||
| if metadata is None: | ||
| console.print(f"[red]Error:[/red] Extension '{extension_id}' not found in registry (corrupted state)") | ||
| raise typer.Exit(1) | ||
|
|
||
| old_priority = metadata.get("priority", 10) | ||
| if old_priority == priority: | ||
| console.print(f"[yellow]Extension '{display_name}' already has priority {priority}[/yellow]") | ||
| raise typer.Exit(0) |
Summary
Changes
Extensions
list_by_priority()method to ExtensionRegistry--priorityoption toextension addcommandextension set-prioritycommandextension listandextension infoextension updatePresets
preset set-prioritycommandpreset infooutputTest plan
Closes #1845
Closes #1854
🤖 Generated with Claude Code