Skip to content

fix(workerd): accept current plugin capability names - #2574

Closed
logelog wants to merge 1 commit into
emdash-cms:mainfrom
logelog:codex/emdash-workerd-capability-aliases
Closed

fix(workerd): accept current plugin capability names#2574
logelog wants to merge 1 commit into
emdash-cms:mainfrom
logelog:codex/emdash-workerd-capability-aliases

Conversation

@logelog

@logelog logelog commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes the Workerd sandbox rejecting manifests that declare current capability names for content, media, users, and network access.

The bridge and generated wrapper now normalize manifest capabilities before checking them. Current names authorize the matching APIs, supported legacy aliases remain accepted, and permission errors report the current names. This also exposes ctx.users when a manifest declares users:read.

Regression coverage exercises current and legacy names through the bridge, generated wrapper, and a real Workerd process. The existing Tests job now runs the deterministic Workerd capability tests because pnpm test:unit does not include @emdash-cms/sandbox-workerd.

Type of change

  • Bug fix
  • Feature (requires maintainer-approved Discussion)
  • Refactor (no behavior change)
  • Translation
  • Documentation
  • Performance improvement
  • Tests
  • Chore (dependencies, CI, tooling)

Checklist

  • I have read CONTRIBUTING.md
  • pnpm typecheck passes
  • pnpm lint passes
  • pnpm test passes (or targeted tests for my change)
  • pnpm format has been run
  • I have added/updated tests for my changes (if applicable)
  • User-visible strings in the admin UI are wrapped for translation (if applicable). Do not include messages.po changes except in translation PRs — a workflow extracts catalogs on merge to main. Not applicable: this PR does not change the admin UI.
  • I have added and reviewed the user-facing changeset (if this PR changes a published package)
  • New features link to an approved Discussion: not applicable; this is a bug fix.

AI-generated code disclosure

  • This PR includes AI generated code: Claude Opus 5, GPT 5.6 (via private dev orchestra)

Screenshots / test output

Current head 4128e41afdb828422440076e133fc93dfb15d311 is a conflict-free rebase of the Windows-validated candidate e94fe43fd780e33a8784da16613d9d06308d4df5 onto ade23cdc9b400ba34bb1cad5f9fb5a4d3793114f. The source patch is unchanged, and both revisions have stable patch ID 9db0092bb0d7d7d2a145ca1673e64e46a3bcfc8c.

  • macOS arm64 after the rebase, with Node.js 22.23.2 and pnpm 11.9.0: targeted lane 51/51 and full Workerd suite 127/127, with zero skipped tests. Workerd build and typecheck, root typecheck, lint, pnpm format, and git diff --check passed.
  • Windows 11 x64 on the patch-equivalent pre-rebase commit: targeted lane 51/51 and full Workerd suite 127/127, with zero skipped tests. The integration file passed 18/18 using a real Workerd process; removing the binary as a negative control produced 18 skipped tests, confirming the full run did not silently skip runtime coverage.
  • Windows build, Workerd and root typechecks, lint, Prettier, and git diff --check passed. pnpm format:check reported the same 10 symlink-checkout files on the pristine base and candidate because the Windows checkout had core.symlinks=false; this was not a candidate regression.

@changeset-bot

changeset-bot Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 4128e41

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

This PR includes changesets to release 1 package
Name Type
@emdash-cms/sandbox-workerd Patch

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

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 640 lines across 12 files. Large PRs are harder to review and more likely to be closed without review.

If this scope is intentional, no action needed. A maintainer will review it. If not, please consider splitting this into smaller PRs.

See CONTRIBUTING.md for contribution guidelines.

@pkg-pr-new

pkg-pr-new Bot commented Aug 20, 2026

Copy link
Copy Markdown

Open in StackBlitz

@emdash-cms/admin

npm i https://pkg.pr.new/@emdash-cms/admin@2574

@emdash-cms/auth

npm i https://pkg.pr.new/@emdash-cms/auth@2574

@emdash-cms/auth-atproto

npm i https://pkg.pr.new/@emdash-cms/auth-atproto@2574

@emdash-cms/blocks

npm i https://pkg.pr.new/@emdash-cms/blocks@2574

@emdash-cms/cloudflare

npm i https://pkg.pr.new/@emdash-cms/cloudflare@2574

@emdash-cms/contentful-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/contentful-to-portable-text@2574

emdash

npm i https://pkg.pr.new/emdash@2574

create-emdash

npm i https://pkg.pr.new/create-emdash@2574

@emdash-cms/gutenberg-to-portable-text

npm i https://pkg.pr.new/@emdash-cms/gutenberg-to-portable-text@2574

@emdash-cms/plugin-cli

npm i https://pkg.pr.new/@emdash-cms/plugin-cli@2574

@emdash-cms/plugin-types

npm i https://pkg.pr.new/@emdash-cms/plugin-types@2574

@emdash-cms/registry-client

npm i https://pkg.pr.new/@emdash-cms/registry-client@2574

@emdash-cms/registry-lexicons

npm i https://pkg.pr.new/@emdash-cms/registry-lexicons@2574

@emdash-cms/registry-verification

npm i https://pkg.pr.new/@emdash-cms/registry-verification@2574

@emdash-cms/sandbox-workerd

npm i https://pkg.pr.new/@emdash-cms/sandbox-workerd@2574

@emdash-cms/x402

npm i https://pkg.pr.new/@emdash-cms/x402@2574

@emdash-cms/plugin-ai-moderation

npm i https://pkg.pr.new/@emdash-cms/plugin-ai-moderation@2574

@emdash-cms/plugin-atproto

npm i https://pkg.pr.new/@emdash-cms/plugin-atproto@2574

@emdash-cms/plugin-audit-log

npm i https://pkg.pr.new/@emdash-cms/plugin-audit-log@2574

@emdash-cms/plugin-color

npm i https://pkg.pr.new/@emdash-cms/plugin-color@2574

@emdash-cms/plugin-embeds

npm i https://pkg.pr.new/@emdash-cms/plugin-embeds@2574

@emdash-cms/plugin-field-kit

npm i https://pkg.pr.new/@emdash-cms/plugin-field-kit@2574

@emdash-cms/plugin-forms

npm i https://pkg.pr.new/@emdash-cms/plugin-forms@2574

@emdash-cms/plugin-webhook-notifier

npm i https://pkg.pr.new/@emdash-cms/plugin-webhook-notifier@2574

commit: 4128e41

@logelog
logelog force-pushed the codex/emdash-workerd-capability-aliases branch from e94fe43 to 1620247 Compare August 20, 2026 03:17
The Workerd bridge and wrapper were added after the capability rename but still checked the pre-rename names. As a result, manifests using current content, media, users and network capabilities could be denied, and users:read did not expose ctx.users.

Normalize capabilities at the bridge handler and wrapper boundaries, keep supported legacy aliases working, and report current names in permission errors. Add deterministic Workerd capability tests to the existing Tests job because pnpm test:unit does not run this package's tests.
@logelog
logelog force-pushed the codex/emdash-workerd-capability-aliases branch from 1620247 to 4128e41 Compare August 20, 2026 03:18
@logelog logelog closed this Aug 20, 2026
@logelog
logelog deleted the codex/emdash-workerd-capability-aliases branch August 20, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant