Commit 21fb1bb
fix(bundler): resolve built-in step types when checking bundle component references (#3885)
* fix(bundler): resolve built-in step types when checking bundle references
`_resolved_locally` gives three of the four component kinds a
"is it bundled with Spec Kit?" check before the installed-in-project one:
presets -> _locate_bundled_preset or PresetManager.get_pack
extensions -> _locate_bundled_extension or ExtensionManager...is_installed
workflows -> _locate_bundled_workflow or WorkflowRegistry.is_installed
steps -> StepRegistry.is_installed <-- no bundled check
`StepRegistry` tracks *community* step types installed under
`.specify/workflows/steps/`. Spec Kit ships 11 step types as built-ins
registered in `STEP_REGISTRY`, so every one of them looked unresolved:
steps/shell -> False
steps/gate -> False
steps/command -> False
steps/if -> False
A bundle declaring a dependency on any built-in step type was therefore
reported as an unresolved reference — an error online, a warning offline.
There is no `_locate_bundled_step` to mirror, because step types are not
an on-disk asset directory; `STEP_REGISTRY` is the equivalent check, and
is what `specify workflow step info` reports as "built-in".
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(bundler): check an immutable built-in step set, not the mutable registry
Review catch: `STEP_REGISTRY` is not limited to bundled steps.
`load_custom_steps` adds project-installed ids to that process-global
mapping and never removes them, so in a long-lived process a community step
loaded while working on project A would be accepted as "bundled" when
validating a bundle for project B — before B's own StepRegistry is
consulted.
Snapshot the shipped ids into `BUILTIN_STEP_TYPES` immediately after
`_register_builtin_steps()`, before `load_custom_steps` is even defined,
and check that frozenset instead.
Verified: with the check on STEP_REGISTRY the new cross-project test fails
(a leaked community id resolves as bundled); with BUILTIN_STEP_TYPES it
passes. 1 failed, 5 passed -> 6 passed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent bf88c9f commit 21fb1bb
3 files changed
Lines changed: 92 additions & 0 deletions
File tree
- src/specify_cli
- bundler/services
- workflows
- tests/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
45 | 58 | | |
46 | 59 | | |
47 | 60 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
74 | 82 | | |
75 | 83 | | |
76 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
27 | 98 | | |
28 | 99 | | |
29 | 100 | | |
| |||
0 commit comments