Skip to content

fix(core): enforce min_tool_version check during pack install#233

Merged
breferrari merged 4 commits into
mainfrom
fix/197-min-tool-version
Mar 24, 2026
Merged

fix(core): enforce min_tool_version check during pack install#233
breferrari merged 4 commits into
mainfrom
fix/197-min-tool-version

Conversation

@breferrari
Copy link
Copy Markdown
Owner

Summary

  • Packs can declare min_tool_version in their manifest to require a minimum weave version. Previously this field was parsed but never enforced, so incompatible packs would silently install and potentially break.
  • Adds IncompatibleToolVersion error variant and a check_min_tool_version() function that compares pack.min_tool_version against CARGO_PKG_VERSION using semver comparison.
  • Enforces the check in install_from_registry(), install_local() (both normal and dry-run paths), and use_profile::switch() so users always see a clear upgrade message.

Closes #197

Test plan

  • Unit test: pack with min_tool_version higher than current returns IncompatibleToolVersion error
  • Unit test: pack with min_tool_version equal to current succeeds
  • Unit test: pack with no min_tool_version succeeds (backward compatible)
  • E2E test: local pack with min_tool_version = "99.0.0" fails install with clear message
  • cargo fmt --all passes
  • cargo test --lib passes (215 tests, 0 failures)

@breferrari breferrari self-assigned this Mar 24, 2026
Copilot AI review requested due to automatic review settings March 24, 2026 20:43
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enforces min_tool_version from pack.toml so packs that require a newer weave version fail early with an actionable error, rather than installing and potentially breaking.

Changes:

  • Adds a new WeaveError::IncompatibleToolVersion error variant for clear upgrade guidance.
  • Introduces check_min_tool_version() (semver compare vs CARGO_PKG_VERSION) and calls it in registry installs, local installs (including dry-run), and profile switching.
  • Adds unit tests for the version check and an E2E test covering an incompatible local pack.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/core/install.rs Adds check_min_tool_version() and enforces it in install flows; includes unit tests.
src/core/use_profile.rs Enforces min_tool_version during use_profile::switch() (dry-run and normal).
src/error.rs Adds IncompatibleToolVersion error variant and message.
tests/e2e/cli_install.rs Adds E2E coverage for local install failing on incompatible min_tool_version.

@breferrari breferrari merged commit 765da43 into main Mar 24, 2026
3 checks passed
@breferrari breferrari deleted the fix/197-min-tool-version branch March 24, 2026 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: enforce min_tool_version check during pack install

2 participants