Skip to content

fix(release): require workers-scripts.admin in the release manifest (#225) - #229

Merged
Madraka merged 2 commits into
mainfrom
claude/fix-225-workers-admin-scope
Nov 14, 2026
Merged

Madraka merged 2 commits into
mainfrom
claude/fix-225-workers-admin-scope

Conversation

@Madraka

@Madraka Madraka commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

What

The standard release manifest's requiredScopes now names Workers Admin (workers-scripts.admin) instead of Workers Editor (workers-scripts.edit).

Installing a release creates the site Worker and the admin Worker. Since Cloudflare introduced granular Worker roles (changelog 2026-09-15), an Editor cannot create Workers. So a grant built from the old list could not install a release. The asset upload for the new site Worker answered 403 with an empty errors array, as the issue reports.

Changes

  • scripts/release-bundle/standard.ts: workers-scripts.edit → workers-scripts.admin, with a comment.
  • packages/cli/test/release-bundle.test.ts: a test that fails if the manifest goes back to .edit.
  • packages/core-contracts/fixtures/{valid,invalid}/release-manifest/*.json (10 files): updated to match. The schema is unchanged, because ScopeId is only a pattern. No pnpm gen was needed and nothing generated changed.
  • docs/rfcs/0046-release-bundles.md §3: a dated "Scopes" note with the consumer rule.

Old manifests (v0.9.0 and earlier)

Releases are immutable, so v0.9.0's manifest keeps workers-scripts.edit. The next release carries workers-scripts.admin. Consumers should treat the old manifests as follows:

  • When comparing a grant with requiredScopes, treat workers-scripts.admin as covering workers-scripts.edit. A grant holding Admin satisfies old and new manifests alike.
  • When building a grant from an older manifest, ask for workers-scripts.admin in place of workers-scripts.edit. A grant with only .edit cannot install a release.
  • This is the only implied scope. Every other scope id is compared exactly.

No code in this repository compares scopes today. The shared verifier designed for #227 will expose this rule as a missingScopes helper.

Not changed

  • RFC-0037's docs-site token ("Workers Scripts edit on this one Worker") updates an existing Worker, so Editor is enough there.
  • No changeset: scripts/ is not published, and @cloudhal/core-contracts ships only dist, schemas and README.md, not its fixtures.

Tests

Not run locally, because the owner's machine is under load. CI is the test run for this PR. The tests that cover it:

  • packages/cli/test/release-bundle.test.ts;
  • the core-contracts fixture tests;
  • the Rust fixture round trip (cargo test).

Closes #225

🤖 Generated with Claude Code

Madraka and others added 2 commits November 14, 2026 10:14
…225)

Installing a release creates the site and admin Workers. Since Cloudflare's
granular Worker roles, Workers Editor (workers-scripts.edit) cannot create a
Worker; a grant built from the manifest's requiredScopes got a 403 on the new
site Worker's asset upload. The standard manifest now names Workers Admin.

- scripts/release-bundle/standard.ts: workers-scripts.edit -> .admin, with a
  test that keeps it so.
- release-manifest fixtures follow (schema unchanged: ScopeId is a pattern).
- RFC-0046 §3: the scopes rule for consumers. Manifests up to v0.9.0 keep
  .edit (immutable releases); a consumer treats .admin as covering .edit and
  asks for .admin when it builds a grant from an older manifest.

Closes #225

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
@Madraka
Madraka merged commit c41a4d7 into main Nov 14, 2026
8 checks passed
@Madraka
Madraka deleted the claude/fix-225-workers-admin-scope branch November 14, 2026 08:08
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.

Release manifest requiredScopes names Workers Editor, which cannot create Workers (use workers-scripts.admin)

1 participant