← zed-pkg home Failure design

A registry outage should not erase public packages.

Zed treats publication authority and artifact availability as separate problems. Writes remain authenticated and fail closed; public reads can use independently verifiable mirrors without turning the edge into a second source of truth.

Current fallback surfaces

Implemented

Public metadata fallback

When the registry origin is unavailable or lacks a public package, registry.zpkg.net can reconstruct bounded version metadata from a public GitHub Release sidecar.

GET /v1/packages/acme/http-kit/versions/1.2.0
x-zed-source: github-public
Implemented

Public artifact proxy

cdn.zpkg.net can proxy an allowlisted public GitHub Release object after validating each redirect and enforcing a bounded content length.

GET /github/acme/http-kit/v1.2.0/zpkg-acme-http-kit-1.2.0.tar.gz
x-zed-edge: cdn
x-zed-source: github-release
Implemented

Direct GitHub consumption

The CLI can read public Release metadata and bytes directly when the configured registry and public object source are unavailable. Frozen installs remain governed by the lockfile digest.

Live certification

Write fallback round trip

The CLI mirrors supported GitHub-backed publishes to Releases. A dedicated public canary now verifies the real publish, Cloudflare read, direct install, and frozen reinstall chain before this site presents the complete path as generally available.

What Cloudflare does - and does not do

RequestEdge policyReason
Authenticated publish, yank, or ownership change Origin only; return a typed unavailable response if the write origin is down A public proxy must not invent authorization or become a confused-deputy writer.
Public package/version read Origin first, then independently public bounded metadata sources Public availability can degrade gracefully without mutating registry state.
Immutable artifact read Private R2 content-addressed object or validated public upstream The response is safe only when identity, redirects, size, and cache policy are constrained.
Unknown route or unsupported method Reject before any upstream network call The edge state machine keeps non-registry paths out of the origin and fallback clients.

The live canary acceptance gate

The canary is intentionally owned by the repository whose Release it writes. Its repository-scoped Actions token never needs sibling-repo write authority.

1. Publish

Build an exact CLI SHA, make the registry unreachable, and require zed publish to report a successful GitHub Release mirror.

2. Compare

Match direct GitHub, sidecar, registry fallback, and Cloudflare CDN SHA-256, size, download URL, and byte content.

3. Restore

Disable registry and R2 access, install directly from GitHub, wipe the store, then require --frozen to restore without lock drift.

No silent green checks

A helper that uploads handcrafted bytes can isolate GitHub API health, but only the product-path canary certifies the real CLI metadata and fallback contract end to end.

Operator expectations during an outage

  • Existing public, pinned packages may remain installable through recorded or independently public sources.
  • Fresh public metadata reads may degrade to GitHub/native fallbacks and expose an explicit x-zed-source header.
  • Registry mutations remain unavailable until the authenticated write origin is healthy.
  • Private packages do not become public merely because a fallback path exists.
  • Digest, size, redirect, and hostname checks fail closed rather than serving an ambiguous artifact.