Skip to content

Let a plugin manifest name the oldest Buzz it runs on - #4255

Closed
BurningMoneySlowly wants to merge 1 commit into
block:mainfrom
BurningMoneySlowly:tylerg/plugin-min-buzz-version
Closed

BurningMoneySlowly wants to merge 1 commit into
block:mainfrom
BurningMoneySlowly:tylerg/plugin-min-buzz-version

Conversation

@BurningMoneySlowly

Copy link
Copy Markdown
Contributor

Why

Today a plugin has to stay compatible with every Buzz build it might be installed on. Nothing stops an older Buzz from installing a plugin, or updating to a version of it, that uses host features that older build doesn't have. So authors feature-detect each capability (ctx.host?.runCommand?.(...), "On Buzz 0.7.19 and later…") and keep fallbacks around indefinitely.

This is a proposal: let a plugin release say which Buzz it needs, so it can drop that compatibility code instead of carrying it.

What

  • Manifest field. A manifest can set an optional "minBuzzVersion": "1.2.0". validate accepts only a plain MAJOR.MINOR.PATCH (no ranges, prereleases or v prefix).
  • Version source. The desktop passes its own version (context.package_info().version, which release builds set via --config candidate.json) to the plugin Manager with with_buzz_version.
  • Gate. install_artifact_if, which every install and update path goes through (folder, Git and URL imports, and automatic managed updates), and reload refuse a plugin whose minBuzzVersion is newer than the running Buzz. The error is "Example needs Buzz 1.5.0 or later, and this is Buzz 1.4.0. Update Buzz to install it." The installed copy stays where it is.
  • Prereleases. A prerelease counts as its release: 1.5.0-preview.3 and 1.5.0-beta.1 satisfy 1.5.0.
  • CLI. buzzodz passes no version and refuses nothing.

Older Buzz builds

The manifest is parsed with deny_unknown_fields, so a Buzz from before this change already rejects a manifest that sets minBuzzVersion. The gate fails closed on old builds too; they just show an "unknown field" error instead of the friendly one.

Why the check isn't in Manifest::validate

Manager::read runs validate() on every installed manifest and fails the whole registry if one fails. If the version check lived there, downgrading Buzz below a plugin's minimum would stop every plugin from loading. So validate checks only the field's syntax, and the version comparison runs only when new bytes come in.

Open questions for maintainers

  1. Field shape. minBuzzVersion is a flat string. Something like "requires": { "buzz": "1.2.0" } would leave room for other requirements later. I went with the smallest shape.
  2. Prereleases. Should a prerelease count as its release? Strict semver says no (1.5.0-preview.3 < 1.5.0). But previews are "one patch above the highest stable", so under strict semver, preview users couldn't install plugins that need features they already have. The cost is that an early preview of 1.5.0 built before the feature landed would also pass.
  3. After a downgrade. A plugin installed under a newer Buzz still loads after a downgrade. Refusing it there would need a non-fatal "unavailable" state in the catalog, which seems like more than this needs.
  4. Showing it before the click. Import previews and managed "update available" entries don't check the version yet, so the error only shows when the person tries to install. A follow-up could check in the import preview and mark managed entries as needing a newer Buzz.
  5. api.ts is FOUNDATION. This adds one optional field (minBuzzVersion?: string) to PluginManifest, the public plugin contract. It needs a maintainer's explicit go-ahead.

Tests

New tests in crates/plugin-manager/src/lib.rs:

  • min_buzz_version_is_a_release_version_and_absent_by_default: old manifests round-trip without the field; valid and invalid version strings.
  • app_versions_compare_by_release_and_prereleases_count_as_their_release: ordering (including 1.9.9 vs 1.10.0), prerelease handling, and the error text.
  • a_plugin_that_needs_a_newer_buzz_is_not_installed_updated_or_reloaded: a refused install leaves nothing installed. A refused update or reload keeps the current revision. A newer Buzz installs it, and the older manager still lists it afterwards.

Checks run at this commit:

  • cargo test -p buzzodz-plugins: 139 lib tests plus the integration suites pass.
  • cargo clippy -p buzzodz-plugins --all-targets: clean.
  • cargo check -p Buzz: compiles.
  • pnpm typecheck: passes.

Not tested in the running app.

Docs

  • docs/plugin-authoring-guide.md (contract rules): describes the field.
  • docs/plugins.md: points to it.
  • docs/managed-plugins.md: what happens when a policy pins a version that needs a newer Buzz.

🤖 Generated with Claude Code

A plugin that starts using a host feature has to keep working on every
Buzz that lacks it, by feature-detecting each one, because nothing stops
an older Buzz from installing or updating to it.

A manifest can now set "minBuzzVersion": "1.2.0". The desktop tells the
plugin manager its own version, and an install, update or reload to a
plugin that needs a newer Buzz is refused with a message naming both
versions; an installed copy stays where it is. A prerelease counts as its
release. A Buzz from before this field already refuses such a manifest as
an unknown key.

The check is not part of Manifest::validate, which runs on every
installed plugin each time the registry is read, so a plugin installed
before a downgrade does not stop the others from loading. The buzzodz CLI
passes no version and refuses nothing.

Co-authored-by: Swiper <24077d5cda8e7e757be4b5e182ef5a8daf7c0447eb339cbf9c3d148fbcc8ecfa@buzz.block.builderlab.xyz>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tyler Green <tylerg@squareup.com>
@BurningMoneySlowly
BurningMoneySlowly force-pushed the tylerg/plugin-min-buzz-version branch from cc81910 to 1fd00c6 Compare November 23, 2026 16:48
@BurningMoneySlowly

Copy link
Copy Markdown
Contributor Author

🤖 Moved to #4264, the same commit on a branch in this repo instead of a fork.

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.

1 participant