Skip to content

Rewrite only the vendored Editor SDK entry in the staging install lock - #1492

Merged
callumalpass merged 1 commit into
mainfrom
fix/editor-staging-sdk-sri-rewrite
Nov 13, 2026
Merged

callumalpass merged 1 commit into
mainfrom
fix/editor-staging-sdk-sri-rewrite

Conversation

@callumalpass

Copy link
Copy Markdown
Contributor

Fixes the staging Editor build, which fails every time at pnpm install --frozen-lockfile with ERR_PNPM_TARBALL_INTEGRITY for the registry tarball of @mdbase-dev/sdk@0.1.0-beta.188. Tracked as mdbase-cloud-ops stop #1835.

Cause

apps/editor/scripts/native/install-inputs.mjs builds the staging lock by replacing the production SDK SRI with the staging archive's SRI across the whole file. #1488 made the vendored Editor SDK (sdk-e8ffb806-production-beta188.tgz) byte-identical to the registry @mdbase-dev/sdk@0.1.0-beta.188, which other workspace packages install from npm. Both lock entries now have the same integrity, so the global replace also rewrote the registry entry, and pnpm then rejected the genuine registry tarball. Production builds don't apply this rewrite.

Change

  • The SRI is now replaced only in the vendored file: entry's own resolution line. No other package's resolution is touched, even if it has the same integrity.
  • The rewrite fails closed ("Vendored SDK lock entry not found exactly once") if that exact entry is missing or appears more than once.
  • Unchanged: the lock sha256 check, the production pin check and "never repack the SDK". The basename and alias rewrites of the vendored file references also stay as they were.

Tests

  • New regression test: a lockfile fixture where a registry @mdbase-dev/sdk entry shares the production SRI. It asserts that only the vendored entry changes (registry entry and importer stay unchanged) and that a missing or duplicated vendored entry is refused without writing the lock.
  • The existing staging-install test asserted that the production SRI no longer appeared anywhere in the lock, which encoded the bug. It now asserts that only the staged vendored entry carries the staging integrity. With the real repo lock, it now fails on main and passes here, as does the new test.
  • pnpm ci:local passes. The Editor native-script tests pass except security.test.mjs "cryptographically refuses a real public npm bundle…", which also fails on unmodified main locally (the local global npm has no sigstore module) and is unrelated.

The staging install replaced the production SDK integrity globally. Since
the vendored Editor SDK became byte-identical to the registry
@mdbase-dev/sdk@0.1.0-beta.188 that other workspace packages resolve, the
global replace also changed the registry entry's integrity, and the frozen
install refused the genuine registry tarball (ERR_PNPM_TARBALL_INTEGRITY).

Replace the integrity only in the vendored file: entry's own resolution,
and fail closed unless that entry appears exactly once.
@callumalpass
callumalpass added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 752e46d Nov 13, 2026
32 checks passed
@callumalpass
callumalpass deleted the fix/editor-staging-sdk-sri-rewrite branch November 13, 2026 02:20
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