Skip to content

feat(registry): add aggregator labeler identity resolution - #1949

Merged
ascorbic merged 1 commit into
feat/plugin-registry-labelling-servicefrom
feat/labeler-15-aggregator-identity
Jul 11, 2026
Merged

ascorbic merged 1 commit into
feat/plugin-registry-labelling-servicefrom
feat/labeler-15-aggregator-identity

Conversation

@ascorbic

Copy link
Copy Markdown
Member

What does this PR do?

Implements W4.1 labeler configuration and DID resolution for the plugin registry aggregator:

  • Treats existing labelers rows as the bounded configured-source allowlist.
  • Resolves exactly one #atproto_labeler service and canonical P-256 #atproto_label verification method.
  • Caches endpoint and signing-key material for 24 hours while preserving operator-managed trust metadata.
  • Supports forced refresh and freshness invalidation for the later single signature-failure retry path.
  • Fails closed for malformed documents, unsafe endpoints, invalid keys, and unconfigured DIDs without overwriting the previous valid cache.

Part of umbrella PR #1909. Subscription ingestion remains scoped to W4.2.

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 (targeted and full aggregator suites)
  • pnpm format has been run
  • I have added/updated tests for my changes
  • User-visible strings in the admin UI are wrapped for translation (not applicable: no admin UI)
  • I have added a changeset (not applicable: private app only; no published package changed)
  • New features link to an approved Discussion (not applicable: implementation of the ratified registry labeler spec tracked in Plugin registry labelling service #1909)

AI-generated code disclosure

  • This PR includes AI-generated code; model/tool: OpenCode with GPT-5.6-sol, independently reviewed with Claude Opus 4.8

Screenshots / test output

Non-visual Worker change. Verified with:

  • pnpm build
  • pnpm --filter @emdash-cms/aggregator build
  • pnpm typecheck
  • pnpm --filter @emdash-cms/aggregator typecheck
  • pnpm lint: 0 warnings and 0 errors across 2,080 files
  • pnpm --filter @emdash-cms/aggregator test: 216 tests
  • pnpm --filter @emdash-cms/aggregator exec vitest run test/labeler-resolver.test.ts: 30 tests
  • Targeted formatting and git diff --check
  • Final independent review found no high or medium findings

@changeset-bot

changeset-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: f0530b2

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@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-demo-cache f0530b2 Jul 11 2026, 09:44 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 f0530b2 Jul 11 2026, 09:44 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-demo-do f0530b2 Jul 11 2026, 09:44 AM

@github-actions

Copy link
Copy Markdown
Contributor

Scope check

This PR changes 883 lines across 2 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 11, 2026

@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 adds a self-contained identity resolver for AT Protocol labelers in the aggregator. The approach fits the existing codebase: it mirrors apps/aggregator/src/did-resolver.ts (constructor-injected cache + resolver, invalidate() keeping other timestamps intact, D1 binding kept separate), and it treats the labelers table rows as the operator-managed allowlist by requiring a pre-existing row before any outbound DID resolution. The validation is appropriately strict: DID shape check, exactly one #atproto_labeler service of type AtprotoLabeler, HTTPS endpoint with no credentials or fragment, exactly one #atproto_label verification method with controller match, valid canonical P-256 multikey, and a round-trip multikey check to catch non-canonical encodings. The cache logic preserves existing operator metadata, fails closed on malformed/unconfigured DIDs, and does not overwrite the cache when resolution fails. Tests cover the unit contract and the D1 binding contract, including negative cases.

I reviewed the changed files and cross-checked did-resolver.ts and the existing migrations/0001_init.sql (labelers schema). I did not run the test suite/linter. No line-level bugs or AGENTS.md violations stood out: SQL is parameterized, internal imports use .js, type-only imports are correct, the component is package-private so no changeset is needed, and there is no admin UI/i18n surface area.

One process caveat I cannot verify from the diff: AGENTS.md requires maintainer-approved Discussion for new features; the author links this to umbrella PR #1909 as the ratified registry labeler spec, which I am treating as acknowledged.

Approve — no findings.

@github-actions github-actions Bot added review/approved Approved; no new commits since and removed review/needs-review No maintainer or bot review yet labels Jul 11, 2026
@ascorbic
ascorbic merged commit eeec578 into feat/plugin-registry-labelling-service Jul 11, 2026
10 checks passed
@ascorbic
ascorbic deleted the feat/labeler-15-aggregator-identity branch July 11, 2026 13:37
@ascorbic ascorbic mentioned this pull request Jul 11, 2026
60 of 81 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: signed review/approved Approved; no new commits since size/XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant