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

A group moderates its members' posts in their public repos

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:public-subjects

What changes

Reports. fyi.opensocial.createReport takes a record subject (fyi.opensocial.defs#recordSubject) whose uri is a record in a public repo, at://<did>/<collection>/<rkey>, when <did> holds a role in the group. The reporter must be able to read the members space, as for an account. The labeler's subjectTypes (record) and subjectCollections apply to it as to any record. It enters the queue keyed by its URI, its own subject with its own status, apart from its author's account; listSubjects answers its author as actor. getSubjectHistory and resolveSubject take such a URI too. A public record of someone not a member, and anything else outside the group's spaces, stays InvalidSubject.

Labels. A com.atproto.label.label the group writes in its members space may name, as its uri, a record in the public repo of a member, besides a DID. Writing and deleting one puts labelEvents in that record's history, as for a record in a space. In any other space, or naming a non-member's public record, the label is refused (InvalidRequest), as before.

The host still hides nothing. The design page, the API reference and the lexicons' descriptions say so.

Why

A forum's posts live in each member's own public repo, not in any space of the group's, so its public community could report and label only the member who wrote one, not the post. A member's public record is read by anyone, so its label goes where its author's labels do, the members space, and the reporter is held to the same space as for an account.

How it was checked

moderates_a_members_public_post_as_its_own_subject in crates/group-host/tests/moderation.rs: a member's public post reported and queued as its own subject (its author's history left empty), resolved and read back by its version; a non-member's or the group's own public record, a malformed one, and a reporter who cannot read the members space refused; subjectTypes and subjectCollections applied; a label on the post in the members space written and deleted, each a labelEvent by whom; a label naming a non-member's public record, or a public record in the calendar or meta space, refused.

Shortcomings

The mod_label tool and opensocial mod label still place a label only beside a record in one of the group's spaces or on an account; a public record is labelled by writing the record as the group.

Approved

This lets a group report and label a member's record in their public repo as its own subject. It keeps the host-hides-nothing line, and I found nothing that must change.

  • Reports: public_of checks the DID, NSID and rkey shape, and create_report requires a role for the author. It then files the report in the members space, so the reporter must read that space.
  • Subject handling: the same subjectTypes and subjectCollections checks apply as for any record. Non-member records, the group's own records and malformed URIs stay InvalidSubject.
  • Labels: Host::beside allows a public-record label only in the members space and only for a member's record. Everywhere else the label is still InvalidRequest.
  • account_of: it now handles 3-part public URIs as well as space URIs, so actor resolves for both.
  • Tests and docs: the one new test covers the cases the body lists, and the docs and lexicon descriptions match the behaviour.

I did not run the tests or read the check results. That includes the repository's 100% coverage gate.

Merged as 027c9a3