Skip to content

Bump the plugin SDK version, and fail CI when it is missed - #2271

Merged
andrewkchan merged 2 commits into
get-bb:mainfrom
andrewkchan:bb/plugin-sdk-version-guard-thr_6uabvx9wey
Aug 22, 2026
Merged

andrewkchan merged 2 commits into
get-bb:mainfrom
andrewkchan:bb/plugin-sdk-version-guard-thr_6uabvx9wey

Conversation

@andrewkchan

@andrewkchan andrewkchan commented Aug 22, 2026 •

Copy link
Copy Markdown
Collaborator

now it should be impossible to accidentally change plugin API without bumping the SDK version

we can delete this if later we decide actually want to iterate faster without bumping sdk version

What was wrong

#2270 added app.slots.commandPaletteAction — a public plugin API member —
without moving PLUGIN_SDK_VERSION. Pre-1.0 the major is the compatibility
number and never moves for additive work, so the patch is the only thing a
plugin author can point engines.bbPluginSdk at: isPluginSdkRangeSatisfied
reads that range as a floor within the major. Without a bump, a plugin using
the new slot has no version to require, so installing it on an older bb fails
at runtime instead of legibly at load.

Nothing caught it. version.test.ts only asserts that
packages/plugin-sdk/package.json and PLUGIN_SDK_VERSION agree with each
other
, never that a surface change moved either. And unlike the backend, rpc,
and host contracts — each of which has an enumerated export list in
public-types.test.ts that a new export forces you to edit — app-contract.ts
has no such list, so nothing about the change was visible in review either.

The recent history shows the convention is real: 0.4.9→0.4.10 (plugin styles),
0.4.10→0.4.11 (provider v3), 0.4.11→0.4.12 (experimental_fullFileContents),
0.4.12→0.4.13 (quick palette). #2270 is the break in that run, alongside
3f86b7c80 (#1469), which added 68 lines to app-contract.ts with no bump.

What changed

  • packages/domain/src/plugin-sdk-version.ts, packages/plugin-sdk/package.json
    — 0.4.13 → 0.4.14, keeping the two in the lockstep version.test.ts checks.
  • .github/workflows/check-plugin-sdk-version.mjs — diffs the branch
    against its merge base and fails when it touches a published contract or
    entry file (app-contract, backend-contract, host-contract,
    rpc-contract, provider-bridge, and the index/app/host entries)
    without touching the version file. The message names the offending paths and
    what to do. An unresolvable base skips rather than failing on something the
    author cannot act on.
  • .github/workflows/version-lockstep.yml — runs it as a second job. It
    needs fetch-depth: 0 for the merge base, so it is a separate job rather
    than a step on the existing shallow-clone one.

The check is a workflow script rather than a vitest test because the signal is
a diff against a base commit, which a unit test has no access to. It follows
the existing check-version-lockstep.mjs pattern.

How you verified

Ran the script against three real branch states:

  • this branch (version bumped, no contract change) → "Plugin SDK surface
    unchanged", exit 0
  • a scratch branch off main touching app-contract.ts with no bump → fails,
    naming the file — i.e. it reproduces exactly the miss in Let plugins add rows to the quick palette #2270
  • the same branch with the bump added → passes

Also confirmed no stale pins: plugins/*/dist/*.meta.json carry 0.4.13 but
are untracked build artifacts that re-stamp on the next build, and
plugins/tasks declares bbPluginSdk: ">=0.4.13", a floor that 0.4.14 still
satisfies.

@get-bb/plugin-sdk 129 tests and @bb/server 1922 tests pass; typecheck
clean for @get-bb/plugin-sdk, @bb/domain, and @bb/server; the workflow
YAML parses.

AGENT GENERATED: by Claude Opus 5

andrewkchan and others added 2 commits August 21, 2026 18:40
get-bb#2270 added a public `app.slots` member without moving the version. Pre-1.0
the major is the compatibility number and never moves for additive work, so
the patch is the only thing a plugin author can point `engines.bbPluginSdk`
at — `isPluginSdkRangeSatisfied` reads that range as a floor within the major.
Without the bump a plugin using the new slot has no version to require, and
installing it on an older bb fails at runtime rather than legibly at load.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Nothing caught the omission above. `version.test.ts` only checks that
package.json and PLUGIN_SDK_VERSION agree with each other, and unlike the
backend, rpc, and host contracts, `app-contract.ts` has no enumerated export
list whose edit would have made the change visible in review.

Diff the branch against its merge base: if it touches a published contract or
entry file and not the version, fail with the paths and what to do. The job
needs a full clone, so it checks out with fetch-depth 0 rather than sharing
the existing lockstep job. An unresolvable base skips rather than failing on
something the author cannot act on.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@andrewkchan
andrewkchan merged commit c3b588c into get-bb:main Aug 22, 2026
13 checks passed
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