feat(registry): add moderation evaluator#1917
Conversation
🦋 Changeset detectedLatest commit: b136ab7 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Scope checkThis PR changes 858 lines across 10 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. |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-do | b136ab7 | Jul 10 2026, 02:53 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-playground | b136ab7 | Jul 10 2026, 02:54 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
emdash-demo-cache | b136ab7 | Jul 10 2026, 02:54 PM |
622b42f
into
feat/plugin-registry-labelling-service
There was a problem hiding this comment.
This is the right change in the right place: a small, shared pure evaluator for accepted ATProto registry labels that can be reused by the aggregator, registry client, and core handlers later. The implementation is well-scoped for a W1 slice and keeps broader integration out, matching the PR description and the labelling-service plan.
What I checked:
- Source code (
packages/registry-moderation/src/index.ts) line-by-line. - Unit tests and the ratified fixture corpus.
- Sibling registry packages (
registry-client,registry-lexicons) for workspace conventions. - The implementation spec for label vocabulary, subject rules, and consumer policy.
Headline conclusion: the evaluator logic is sound. Label reduction by (src, uri, val), timestamp ordering/collision detection, negation/expiry handling, CID applicability, source-local override suppression, manual-block precedence, and redaction flag handling all line up with the fixture policy and the spec’s v1 consumer rules. No blocking logic bugs, no AGENTS.md violations (this package has no UI, SQL, routes, or content-table queries), and the changeset/workspace wiring looks correct.
Only minor scaffolding nits: the package is missing the vitest.config.ts and README.md that every sibling registry package includes. Tests still run via vitest defaults, so this is non-blocking.
| "default": "./dist/index.js" | ||
| } | ||
| }, | ||
| "files": [ |
There was a problem hiding this comment.
[suggestion] This package omits vitest.config.ts and README.md, which both sibling registry packages (registry-client, registry-lexicons) include.
Tests still execute via vitest defaults, but adding these files keeps the workspace consistent and documents the public API for consumers. Suggested additions:
vitest.config.ts:
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
environment: "node",
include: ["tests/**/*.test.ts"],
},
});README.md: a short description of the package, exported API (evaluateReleaseModeration), and a note that it is the shared pure evaluator for the labelling service.
What does this PR do?
Adds
@emdash-cms/registry-moderation, the shared pure evaluator for accepted ATProto registry labels.(src, uri, val)with strict timestamp and collision handling.pnpm test:unit.This is the first W1 implementation slice from #1909. It does not yet integrate aggregator, core, admin, CLI, or the labeller service.
Related to #1909 and #694.
Type of change
Checklist
pnpm typecheckpassespnpm lintpassespnpm testpasses (or targeted tests for my change)pnpm formathas been runmessages.pochanges except in translation PRs — a workflow extracts catalogs on merge tomain.Admin i18n is not applicable because this package has no user interface.
AI-generated code disclosure
Screenshots / test output
pnpm buildpassespnpm --filter @emdash-cms/registry-moderation typecheckpassespnpm --filter @emdash-cms/registry-moderation test: 51 passedpnpm test:unitpasses and includes registry-moderationpnpm lint: 0 warnings and 0 errorspublintpassespnpm changeset statusresolves the initial package release to0.0.1git diff --checkpassesattw --packstill crashes internally afterpublintsucceeds. The identical crash is reproducible in existing@emdash-cms/registry-client; this PR does not add a package-specific workaround.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/labeller-08-moderation-core. Updated automatically when the playground redeploys.