Skip to content

feat: doctor detects version drift across every version-carrying file - #170

Open
unional wants to merge 1 commit into
mainfrom
up-164-doctor
Open

unional wants to merge 1 commit into
mainfrom
up-164-doctor

Conversation

@unional

@unional unional commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Refs #164 (item 5)

What

  • universal-plugin publish check-version: a new read-only command. It exits 1 when any file that carries the plugin version disagrees with the release's number, and it names each disagreeing file. The release's number comes from the packagePath package.json when one is declared, otherwise from plugin.json. The command compares:
    • the canonical plugin.json (a manifest with no version drifts when the package has one)
    • each declared vendor's derived manifest
    • this plugin's entry in each repository catalog
    • every skill file that pins the package (npx/upx <pkg>@<ver>, with -y or --yes). Pins are read with plugin bundle's reader. Pin-exempt skills and pins that aren't versions (<version>, latest) are skipped.
  • The stderr next step names the command that fixes the first kind of drift: sync-version, plugin build, or plugin bundle.
  • doctor: asks check-version for the comparison and reports one version-drift finding per file. When the CLI is too old to have the command, doctor falls back to comparing the two authored files. doctor stays advisory and always exits 0.
  • doctor-universal-plugin skill: when it finds drift, it checks whether the repo already runs check-version. If not, it offers to add it to the verify script or the CI workflow, and asks before editing either.
  • Spec: added a check-version section and scenarios to plugin/version (README and .feature) and an amendment note to ADR-0010 §6. The website docs and a changeset are included.

Notes

  • The pure comparison lives in src/version/drift.ts. It reuses extractPins and isPinExempt and adds no new pin reader, so a sibling change that makes sync-version rewrite pins shouldn't conflict beyond publish/cli.ts.

Tests

  • src/version/drift.test.ts: unit tests for the comparison
  • src/publish/check-version.test.mts: CLI tests on a monorepo git fixture, including the issue's 0.9.0/0.8.0 case
  • src/doctor-script.test.mts: one finding per drifted file, and drift with no npm package
  • pnpm verify passes (759 tests)

🤖 Generated with Claude Code

Add `publish check-version`, a read-only check that exits 1 when the
packagePath package.json, plugin.json, the derived vendor manifests, the
repository catalogs, or the skill npx/upx pins disagree, naming each file.
doctor asks it and reports one version-drift finding per file, and the
doctor skill offers to add the check to the repo's verify script or CI.

Refs #164 (item 5)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: e7eebdc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
universal-plugin Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

This branch has not been deployed

No deployments
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