You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add regex: selectors for preset templates, scripts, and commands. Existing exact-name matching remains unchanged; regex patterns are validated and matched against complete resource names.
Command selectors are expanded to concrete lower-layer command names before registration, keeping selector expressions out of command filenames and registry records. Reconciliation and diagnostics handle matched resources across preset lifecycle changes.
Ran targeted selector, resolver, manifest, and command lifecycle tests: 376 passed
Ran Python parity tests: 98 passed, 2 skipped
Ran Ruff checks, ShellCheck, PowerShell syntax parsing, Python compilation, and git diff --check
AI Disclosure
I did not use AI assistance for this contribution
I did use AI assistance (fill in the disclosure below)
AI disclosure: Implemented with Hermes Agent (Nous Research), using the gpt-6-Astra model in an interactive, human-supervised workflow. AI assistance was used for code changes, tests, debugging, and validation; the contributor should review the final diff before merging.
Add regex:<pattern> selectors for preset templates, scripts, and commands while preserving exact-name behavior. Validate regex patterns and use full-name matching. Expand command selectors to concrete lower-layer commands before registration and reconcile affected commands across preset lifecycle changes.
Add selector, resolver, command lifecycle, and diagnostic coverage. Verified with the full test suite (8415 passed, 211 skipped), Ruff, ShellCheck, PowerShell syntax parsing, Python compilation, and git diff --check.
Closesgithub#4659
Add regex:<pattern> selectors for preset templates, scripts, and commands while preserving exact-name behavior. Resolve all matching declarations in manifest order, expand command selectors before registration, and reconcile matches after preset and extension changes. Add selector diagnostics and regression coverage.
Closesgithub#4659
Added command regex selectors to normal layer resolution and composition.
Preserved all matching regex declarations in manifest order.
Fixed the invalid _selectors imports used by diagnostics.
Reused selector expansion for AI-skill registration.
Added selector-aware reconciliation for relevant preset/extension lifecycle changes.
Also added regression coverage for overlapping selectors, command composition strategies, diagnostics, AI-skill registration, and lifecycle state changes.
All previous Copilot review findings have been addressed and the updated test suite is passing. The latest Copilot re-review appears to have failed due to a review error, so the PR is ready for another review when convenient.
Add install-time warnings for unmatched template, script, and command selectors while keeping zero-match selectors non-fatal.
Reconcile constitution snapshots when regex selectors target the constitution template, and preserve concrete command matches during AI skill registration and reconciliation.
Include extension manifest-declared resources in selector diagnostics so reported matches stay consistent with actual resolver behavior.
Handle preset and extension lifecycle changes using selector-aware reconciliation to remove stale command and skill artifacts and restore newly matching resources.
Make priority-change reconciliation failures consistent with existing lifecycle behavior and add regression coverage for enable, disable, priority, diagnostics, constitution, and skill scenarios.
Stale artifacts remain when selectors lose all matches
src/specify_cli/extensions/_commands.py:121
This refresh runs only after the extension state has changed, so a selector whose sole lower layer was disabled or removed now expands to nothing. register_enabled_presets_for_agent() never sees the previously materialized concrete name, and its reconciler also skips names with no remaining layers, leaving the old command/SKILL artifact active. Capture the pre-mutation matches (or persisted registrations), reconcile the union with post-mutation matches, and explicitly unregister names that no longer resolve.
text
- Expand regex command selectors before resolving layers and registering AI skills.
- Track concrete command and skill names for regex-owned and composed commands.
- Reconcile generated artifacts when presets are disabled or re-enabled.
- Preserve the Templates count in preset info output.
- Add end-to-end tests for selector artifact lifecycle and composition.
Validation:
- 8,626 passed, 17 skipped
- Ruff checks passed
- git diff --check passed
Selector diagnostics and expansion run after the preset directory and registry entry are created but before the existing rollback guard. _expand_command_selectors() deliberately raises when artifact enumeration fails, so such a failure leaves an enabled, partially installed preset behind. Move both calls into the guarded installation phase so the established cleanup executes.
Re-enumeration causes false failure after registration
src/specify_cli/presets/_manager.py:507
This repeats artifact enumeration outside the transactional registration block. If inventory changes or becomes unreadable after registration, the command reports installation failure even though the preset and artifacts are already committed. Reuse the concrete command_templates computed for registration.
- Track expanded selector matches through preset and extension lifecycle operations.
- Clean up generated command and skill artifacts when providers are disabled or removed.
- Preserve registry provenance and restore prior installs when preset or extension installation fails.
- Add lifecycle and failure-injection regression tests.
@mnriem I've addressed the latest Copilot feedback in commit 1ce59c1, including the disabled-extension fallback, include_disabled handling, stale selector tracking/cleanup, and install rollback coverage.
When convenient, could you please re-request the Copilot review? Thanks!
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
triage-can-waitVerdict: valid and in-scope but deprioritized; held behind the evidence gate
3 participants
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.
Add regex: selectors for preset templates, scripts, and commands. Existing exact-name matching remains unchanged; regex patterns are validated and matched against complete resource names.
Command selectors are expanded to concrete lower-layer command names before registration, keeping selector expressions out of command filenames and registry records. Reconciliation and diagnostics handle matched resources across preset lifecycle changes.
Closes #4659
Testing
AI Disclosure
AI disclosure: Implemented with Hermes Agent (Nous Research), using the gpt-6-Astra model in an interactive, human-supervised workflow. AI assistance was used for code changes, tests, debugging, and validation; the contributor should review the final diff before merging.