Skip to content

feat(presets): resolve and materialize script artifacts - #4834

Open
mikamikasuki wants to merge 1 commit into
github:mainfrom
mikamikasuki:feat/4819-script-resolution
Open

mikamikasuki wants to merge 1 commit into
github:mainfrom
mikamikasuki:feat/4819-script-resolution

Conversation

@mikamikasuki

Copy link
Copy Markdown

Description

Adds --kind script to specify preset resolve and --output PATH to materialize the effective script for composed script presets. Documents output overwrite behavior and how relative imports resolve from the chosen output directory.

Closes #4819.

Testing

  • uv run pytest -q tests/specify_cli/presets/test_command_resolve.py (12 passed)
  • uv run pytest -q tests/specify_cli/presets/test_resolver.py (74 passed)
  • Ruff check and format check on changed Python files
  • git diff --check

AI Disclosure

  • I did use AI assistance.

Codex using the GPT-6 model family with the session-default reasoning setting, under human supervision. AI assistance generated the implementation, tests, and documentation. I reviewed the changes line by line and ran the tests listed above.

Assisted-by: Codex (model: GPT-6 family, supervised)
@mikamikasuki
mikamikasuki requested a review from mnriem as a code owner October 4, 2026 09:44
@mnriem mnriem added the triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate label Oct 4, 2026
@mnriem
mnriem requested a balanced review from Copilot October 5, 2026 14:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Replace-layer composition diagnostics regress, and materialization failure paths lack CLI coverage.

Review effort: Balanced
Findings: 1 Medium severity · 1 Low severity

Open (2)
What changed in this PR

Adds CLI support for resolving and materializing preset scripts, addressing the consumption gap described in #4819.

Changes:

  • Adds explicit artifact-kind selection and script output generation.
  • Documents overwrite behavior and relative-import resolution.
  • Adds script-resolution and materialization tests.
File Description
tests/​specify_cli/​presets/​test_command_resolve.py Tests script lookup, composition output, and option validation.
src/​specify_cli/​presets/​command_resolve.py Adds --kind, --output, and script guidance.
docs/​reference/​presets.md Documents script resolution and output behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

has_composition = layers[0]["strategy"] != "replace" and any(
layer["strategy"] != "replace" for layer in layers
)
has_composition = any(layer["strategy"] != "replace" for layer in layers)
Comment on lines +62 to +64
if output is not None:
try:
content = resolver.resolve_content(template_name, "script")
@mnriem

mnriem commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Please address Copilot feedback and fix test & lint errors

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage-can-wait Verdict: valid and in-scope but deprioritized; held behind the evidence gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Preset script artifacts cannot be resolved to usable paths through the CLI

3 participants