Skip to content

feat(registry): verify authoritative release records - #1969

Merged
ascorbic merged 2 commits into
feat/delegated-release-servicefrom
feat/delegated-release-service-11-record-verification
Jul 12, 2026
Merged

ascorbic merged 2 commits into
feat/delegated-release-servicefrom
feat/delegated-release-service-11-record-verification

Conversation

@ascorbic

@ascorbic ascorbic commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Implements W2.6 and W2.7 from the delegated release plan. It adds shared signed record, policy, artifact, and provenance verification plus authoritative direct-PDS profile and release reads with bounded transport, canonical CID checks, complete enumeration, and deterministic semver baseline selection.

Part of #1908 and implements the approved protocol in #1870.

Closes: N/A, integration work for #1908.

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. N/A: no admin UI changes.
  • I have added a changeset (if this PR changes a published package)
  • New features link to an approved Discussion. N/A: maintainer-owned implementation of approved RFC RFC: Attested Automated Publishing #1870 under umbrella Delegated release service #1908.

AI-generated code disclosure

  • This PR includes AI-generated code, model/tool: OpenCode with GPT-5.6-sol plus independent second-opinion and review agents.

Screenshots / test output

No visual changes.

  • Full monorepo build and typecheck pass.
  • Registry client: 100 tests pass.
  • Registry verification: 93 Node tests and 34 workerd tests pass.
  • Type-aware lint reports 0 diagnostics.
  • Formatting, frozen-lockfile, package import, publint, and diff checks pass.
  • attw crashes internally with Cannot read properties of undefined (reading 'filename'); independent package/import checks pass.

Try this PR

Open a fresh playground →

A full working EmDash site, deployed from this branch. Each visit gets its own session-scoped sandbox: no login needed and no shared state. Try the admin, edit content, hit the public site.

Tracks feat/delegated-release-service-11-record-verification. Updated automatically when the playground redeploys.

@changeset-bot

changeset-bot Bot commented Jul 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 343dca7

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

This PR includes changesets to release 19 packages
Name Type
@emdash-cms/registry-client Minor
@emdash-cms/registry-verification Minor
@emdash-cms/admin Patch
emdash Patch
@emdash-cms/plugin-cli Patch
@emdash-cms/cloudflare Patch
@emdash-cms/sandbox-workerd Patch
@emdash-cms/fixture-perf-site Patch
@emdash-cms/perf-demo-site Patch
@emdash-cms/cache-demo-site Patch
@emdash-cms/do-demo-site Patch
@emdash-cms/do-solo-demo-site Patch
@emdash-cms/auth Patch
@emdash-cms/blocks Patch
@emdash-cms/gutenberg-to-portable-text Patch
@emdash-cms/x402 Patch
create-emdash Patch
@emdash-cms/auth-atproto Patch
@emdash-cms/plugin-embeds 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 1,793 lines across 15 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.

@github-actions github-actions Bot added size/XL review/needs-review No maintainer or bot review yet cla: signed labels Jul 12, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
emdash-demo-cache 343dca7 Jul 12 2026, 08:13 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
emdash-playground 343dca7 Jul 12 2026, 08:14 AM

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
emdash-demo-do 343dca7 Jul 12 2026, 08:14 AM

@ascorbic
ascorbic merged commit 8b3e5ea into feat/delegated-release-service Jul 12, 2026
6 of 8 checks passed
@ascorbic
ascorbic deleted the feat/delegated-release-service-11-record-verification branch July 12, 2026 08:18

@emdashbot emdashbot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is a well-scoped, architecture-consistent addition to the registry work: it introduces an authoritative direct-PDS read path in registry-client and centralizes record/policy/provenance verification in registry-verification. The code is generally careful about fail-closed validation, size/time bounds, identity checks, and semver baseline selection.

I reviewed the diff, read every changed file, and traced conventions in the existing registry packages. Most of the implementation looks solid, but I found three issues worth addressing:

  1. Bounded transport is missing redirect control. The new createBoundedFetch wrapper advertises bounded transport but forwards the fetch call without a redirect option. A compromised or malicious PDS could redirect the client to arbitrary origins or force extra round trips before the byte limit kicks in. The sibling fetch.ts in registry-verification validates redirects and hosts; direct-PDS should at least not silently follow cross-origin redirects.

  2. The CID check re-encodes a JSON-deserialized record. verifyRecordCid recomputes the DAG-CBOR CID from the value returned by @atcute/lexicons/validations safeParse. Unless @atcute/cbor encode canonicalizes map key order exactly like the PDS's stored DAG-CBOR, this can reject legitimate records when the PDS JSON response orders fields differently or when numeric CBOR types don't round-trip through JSON's float64. Confirming this needs a real PDS round-trip, but it's the kind of subtlety that is easy to miss in fixture-based tests.

  3. Test helpers are exported from production code. provenance.ts exports provenanceTestInternals from the public module surface. Test-only utilities should live in a test module or be marked @internal so they don't become part of the published API.

None of these are severe enough to block merge, but (1) in particular is a security/contract gap for a feature that emphasizes bounded transport.


Findings

  • [needs fixing] packages/registry-client/src/direct-pds/index.ts:390

    The bounded fetch wrapper forwards the caller's init to fetchImplementation without setting redirect, so the client silently follows any redirects returned by the configured PDS. This undermines the "bounded transport" goal: a compromised publisher PDS could redirect the request off-origin or cause extra round trips before the byte limit is reached. Either set redirect: "manual" and treat redirects as errors, or track and validate redirect locations like registry-verification/src/fetch.ts does.

    					fetchImplementation(input, { ...init, signal: controller.signal, redirect: "manual" }),
    
  • [suggestion] packages/registry-client/src/direct-pds/index.ts:351

    The CID is recomputed from the JSON-deserialized, safeParse-validated record value. This only matches the original record CID if @atcute/cbor encode canonicalizes map keys exactly like the PDS's stored DAG-CBOR and if every numeric value survives the JSON float64 round-trip. With fixture data the test passes by construction; verify that this works against a real atproto PDS response where key order and numeric types may differ, otherwise valid records could be rejected.

  • [suggestion] packages/registry-verification/src/provenance.ts:389

    provenanceTestInternals exposes DER-decoding helpers in the production public API surface purely for tests. Move these test helpers into a test-only module (or mark them @internal) so they don't become accidental public API.

@github-actions github-actions Bot added review/awaiting-author Reviewed; waiting on the author to respond and removed review/needs-review No maintainer or bot review yet labels Jul 12, 2026
@ascorbic ascorbic mentioned this pull request Jul 12, 2026
37 of 63 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed review/awaiting-author Reviewed; waiting on the author to respond size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant