fix(bundler): enforce version pin on bundled preset/extension installs#3377
Open
jawwad-ali wants to merge 1 commit into
Open
fix(bundler): enforce version pin on bundled preset/extension installs#3377jawwad-ali wants to merge 1 commit into
jawwad-ali wants to merge 1 commit into
Conversation
The bundled install branch of _PresetKindManager/_ExtensionKindManager called install_from_directory and returned before _assert_pinned_version, so a bundle manifest pinning e.g. 2.0.0 would silently install the bundled asset's own version (1.0.0) — the pin was only enforced on the catalog path. _WorkflowKindManager already enforces it unconditionally. Read the bundled asset's declared version from its manifest (best-effort; None => cannot enforce, matching the catalog 'advertises no version' escape hatch) and call _assert_pinned_version before install, in both bundled branches. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Description
Bundle manifests pin component versions for reproducibility, enforced by
_assert_pinned_version. But the bundled install branch of_PresetKindManager/_ExtensionKindManagerreturns before that check:So a bundle pinning e.g.
2.0.0silently installs whatever version the bundled asset ships (1.0.0) — the pin is only enforced on the catalog path. Reproduced on main @92b7cf7: aComponentRef(version="2.0.0")against a bundledextension.ymlof1.0.0installs with no error. (_WorkflowKindManageralready enforces the pin unconditionally, so this is an internal inconsistency.)Fix
Read the bundled asset's own declared version from its manifest (best-effort —
Noneon unreadable/invalid, which_assert_pinned_versiontreats as "cannot enforce", matching the catalog "advertises no version" escape hatch) and call_assert_pinned_versionbeforeinstall_from_directoryin both bundled branches.Testing
New tests (mirror the existing
_assert_pinned_version/ bundled-workflow test style):BundlerError"pinned to version 2.0.0", andinstall_from_directoryis not called;version=None) → install proceeds.Mismatch tests fail-before ("DID NOT RAISE", verified by source-stash); full
test_bundler_primitives.py: 15 passed.uvx ruff checkclean.AI Disclosure
Found and fixed with Claude Code (Claude Fable 5) under my direction. AI spotted the early-return bypassing the pin in the bundled branch vs the workflow manager's unconditional enforcement; I reproduced the silent pin violation, verified fail-before/pass-after, and reviewed the diff.