fix extension-local script path rewriting#3364
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes extension command materialization so that extension-owned scripts/... references remain extension-local under .specify/extensions/<extension_id>/scripts/... instead of being rewritten into core .specify/scripts/..., addressing #3358.
Changes:
- Added an optional
extension_idcontext toCommandRegistrar.rewrite_project_relative_paths()and plumbed it through command/skill rendering flows. - Updated extension command + skill registration to pass
manifest.idso top-levelscripts/resolves into the installed extension directory when materializing extension content. - Added regression tests covering both direct path rewriting and auto-registered extension skills.
Show a summary per file
| File | Description |
|---|---|
src/specify_cli/agents.py |
Adds extension_id-aware rewriting so extension scripts/ paths resolve under .specify/extensions/<id>/scripts/ during rendering. |
src/specify_cli/extensions/__init__.py |
Passes manifest.id through extension registration/materialization so extension context is applied consistently. |
tests/test_extensions.py |
Extends unit coverage for _adjust_script_paths() and rewrite_project_relative_paths() with extension context behavior. |
tests/test_extension_skills.py |
Adds regression coverage ensuring auto-registered skills preserve extension-local script paths and don’t rewrite into .specify/scripts/. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Low
Collaborator
|
Thank you! |
kanfil
added a commit
to tikalk/agentic-sdlc-spec-kit
that referenced
this pull request
Jul 7, 2026
Upstream commits merged (9): - 4bb5166 Add Charter extension to community catalog (github#3363) - 1930f89 fix: extension-local script path rewriting (github#3364) - 0e40438 Update Ralph Loop extension to v1.2.1 (github#3365) - 2b5e175 fix(bundler): validate catalog URLs in catalog add (github#3367) - abaed10 chore: release 0.12.6, begin 0.12.7.dev0 (github#3393) - d4e7d2b feat(integrations): generalize post-processing to all format types (github#3311) - 1935cf7 Update Ripple extension to v1.1.0 (github#3370) - 7839acc Update DocGuard extension to v0.30.0 (github#3371) - f764270 Add Orchestration Task Context Management extension (github#3372) Conflict resolution: pyproject.toml (trivial version), agents.py (3-way merge of fork _skip_primary alias-only restructure + upstream extension_id threading + post_process_command_content hook). Assisted-by: OpenCode (model: glm-5.2, autonomous)
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
Fixes #3358.
Extension command materialization now keeps extension-owned
scripts/...references under.specify/extensions/<extension_id>/scripts/...instead of rewriting them to core.specify/scripts/....Root Cause
CommandRegistrar.rewrite_project_relative_paths()treated every top-levelscripts/reference as a core project script. That is correct for built-in commands and../../scripts/...references, but extension command sources may usescripts/...to refer to helper scripts shipped inside the extension archive.During skills/materialization, those paths were rewritten to
.specify/scripts/..., where extension helper scripts do not exist.Changes
../../scripts/..., which still resolve to.specify/scripts/....Validation
PYTHONPATH=src .venv/bin/python -m ruff check src/specify_cli/agents.py src/specify_cli/extensions/__init__.py tests/test_extensions.py tests/test_extension_skills.pyPYTHONPATH=src .venv/bin/python -m pytest tests/test_extensions.py tests/test_extension_skills.py -qPYTHONPATH=src .venv/bin/python -m pytest tests/test_presets.py -qgit diff --checkAI Disclosure
I used Codex to investigate the issue, implement the fix, add tests, and run validation. I reviewed the code paths and test results before submitting.