~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Moderation follows the proposal: mod methods, URI subjects, takedowns

Merged
Merged chadtmiller.com asked to merge into feature/proposal-nov from chadtmiller.com/group-host:moderation/proposal-nov

Moderation catches up with the opensocial proposal's 16–19 Nov changes: the queue's methods are named for moderation, a subject is one URI with an optional version, reasons are plain words, and a group's !takedown label now takes content out of what the host serves.

Claude Opus 5.5

What changes

Renamed methods. fyi.opensocial.listSubjects, getSubjectHistory and resolveSubject are now listModSubjects, getModSubjectHistory and resolveModSubject, answering defs#modSubjectView. Routes, lexicons, the moderate permission set's lxms, the rbac scopes for mod.read/mod.resolve, the MCP mod_* tools, the opensocial seed's moderator role, the console, kicker and the docs all follow. No aliases.

Subjects are URIs. createReport, resolveModSubject and modSubjectView take subject (format uri: an account's DID or a record's at-uri) and an optional cid, as getModSubjectHistory already did. defs#accountSubject, #recordSubject and #subjectStatus are gone; statuses are inline enums, as upstream. A cid beside an account is ignored. The MCP crate no longer turns text into a union: the tools take the lexicon's fields as they are.

Reasons are plain words: spam, violation, misleading, nsfw, rude, other in createReport, reportEvent and labeler.reasonTypes, plus our own appeal, so appeals keep working (only the subject may file one, as before). labeler.subjectTypes is account, record. Our copy of com.atproto.moderation.defs is dropped (retired in harness/lexicons.mjs); nothing else refers to it.

Labeler. No createdAt; its policies are labeler#policies (was defs#labelerPolicies). New groups' labelers are written in this shape.

!takedown takes content down. The host did nothing with labels before. Now (takedown.rs) a !takedown label in the group's own repo takes the record it names (only that version, if it names a cid) out of listSpaceRecords, and the files that record holds out of getSpaceBlob. An account's takedown hides everything the account wrote in that space; written in the members space, where account labels go, in every space of the group. Only the group's labels count; one past its exp doesn't. Deleting the label puts it back. The records stay in their writers' repos; the queue still has their history. The console's takedown copy and the moderating guide say so.

InvalidCursor is named, and answered, by listModSubjects, getModSubjectHistory and listJoinRequests (each parses its cursor and refuses one it never gave).

Existing groups

None are kept: the deployed host's groups are wiped when feature/proposal-nov lands, so nothing reads or migrates the old shapes (old reason refs in reports or labelers, a labeler's createdAt, role grants naming the old methods).

How it was checked

New and updated tests in tests/moderation.rs: string subjects (DID, record, bad URIs, bad cid), plain reasons and the labeler's limits, InvalidCursor, and takes_out_of_the_space_what_the_group_takes_down (record takedown, its file, versioned, lapsed, !hide, a member's own label, an account takedown across spaces, and deleting labels). tests/rbac.rs covers the renamed methods' scopes. just lex passes locally; targeted tests passed locally; every check passes on the runner.

Shortcomings

  • Takedowns hide content from everyone the host serves, moderators included; a moderator reviewing an appeal sees its history but not the content.
Approved

This renames the moderation methods, makes a subject one URI with an optional cid, and uses plain-word reasons. It also makes a group's !takedown labels hide records and files in listSpaceRecords and getSpaceBlob.

I read the new takedown.rs, the serving changes in index_api.rs, the moderation.rs changes, the rbac legacy-grant mapping and the SQL migration. I also read the createReport, resolveModSubject and labeler lexicons. I did not read the other 36 files, which are renames, docs, tests, MCP, web and example changes. I did not run the checks.

  • Takedown is complete for what the host serves. The only reads of the space index are list_space_records and get_space_blob, and both filter. The pagination loop advances its cursor past hidden rows, so a page of hidden records can't stall or end the listing early.
  • Cursors and expiry are handled. Lapsed labels are ignored, and a cid-scoped label hides only that version.
  • Legacy data is read compatibly. labeler_of maps the old reason refs to words and drops createdAt. rbac::grants rewrites old rpc: method names. The migration only touches rows beginning com.atproto.moderation.defs#reason, and leaves any other reason as it was.
  • The 256-byte reasonType check moved into the lexicon. maxLength: 256 in the lexicon now carries it, and accepts still checks the labeler's list.

One thing for the author to know, not to block on. A record !takedown written in the members space also hides a record in another space, because hides matches the record's URI. The comment in taken_down says a record's label covers only its own space. That only matters for labels the group wrote itself, so it isn't a security problem.

Approved

Since my approval at 75608355, the only changes are refreshed moderation guide screenshots and their text snapshots. The new text matches the takedown behavior described in the pull. No code changed, so my earlier approval stands.

Approved

Since my approval at 69713143, the only change is in tests/moderation.rs. Two assertions are rewrapped, and they now compare against picnic.as_str() instead of a clone. No behavior changed, so my earlier approval stands.

Approved

Since my approval at 0897367b, the only change is one assertion in crates/opensocial/tests/commands.rs. It now expects subject to be the DID string, which matches the URI-subject change in this pull. No behavior changed, so my earlier approval stands.

Approved

Since my approval at 929b0a8a, the only change is a refactor of named_now in rbac.rs. It now splits the scope at the ? and keeps the ? with the query. The old code did the same, apart from one case: a bare trailing ? used to be dropped and is now kept. That makes no practical difference. My earlier approval stands.

chadtmiller.com added 2 commits
Approved

Since my approval at b8e42007, the only commits are merges of feature/proposal-nov into the branch. They bring in the base's changes (the role-grant and inbox pulls), not changes of this pull's own. I found no conflict markers in the tree. Lint, lexicons, docs and web checks pass at this head. The test and e2e checks were still running when I looked, and I did not read the merge diff. My earlier approval stands.

Merged as 90b5207