Skip to content

fix(validators): name the package version in ownership-failure errors - #1544

Open
sronix wants to merge 1 commit into
modelcontextprotocol:mainfrom
sronix:fix/ownership-errors-name-version
Open

fix(validators): name the package version in ownership-failure errors#1544
sronix wants to merge 1 commit into
modelcontextprotocol:mainfrom
sronix:fix/ownership-errors-name-version

Conversation

@sronix

@sronix sronix commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Closes #1525.

Why

Ownership errors showed the expected and found values, but did not identify the package version that was checked.

In #1525, packages[].version still named the previous release. The error therefore looked like stale package metadata. Including the validated version makes this cause clear.

NuGet already includes the version in its ownership error.

What changed

  • Include the package identifier and version in npm, PyPI, and Cargo ownership errors.
  • Include the full image reference in the OCI ownership error.
  • Test each changed failure path.

This does not change validation behavior.

Test plan

  • go test -race ./internal/validators/...
  • go vet ./...
  • golangci-lint v2.11.4
  • git diff --check

An ownership failure (mcpName mismatch, missing mcpName, missing or glued
mcp-name token, OCI label mismatch) reported which value was found but not
which package version it was read from. A publisher whose server.json still
names an older release then reads the value as belonging to the release they
just published and looks for the fault in the wrong place (modelcontextprotocol#1525).

NuGet already says "ownership validation for version X failed". This brings
npm, PyPI, cargo and OCI in line: npm, PyPI and cargo name the version, OCI
names the full image reference, which carries the tag or digest.

Message text only, no behavior change. Existing tests match on substrings
and stay green; new hermetic cases assert the version is present.
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.

Publish rejects correct mcpName as stale/mismatched — npm registry confirms it's correct

1 participant