chadtmiller.com/group-host
atmosphere group host
Labels are the proposal's com.atproto.label.label, written as the group
MergedThis replaces the fyi.opensocial label methods and record with com.atproto.label.label records written as the group. It folds takedown into label, grants it as space:*?collection=com.atproto.label.label, and has the host keep the queue's label and negate events when a label is written or deleted. I found nothing that must change.
What I checked in moderation.rs, token_writes.rs, member_writes.rs, group_tokens.rs, oauth_scope.rs and rbac.rs:
- Subject check:
besideruns fromguardfor every token write. It compares the whole space URI, so a label can't point into another space. Account DIDs are allowed. - Ordering:
labels_goingreads a deleted label before the write, andlabelledrecords the event only after the write succeeds. A delete of a label that doesn't exist writes no event. - Label authority:
may_spacechecks the label rule (labels_in) ahead of the members-space rule, so a label in the members space isn't blocked by the member rules.member_writesnow skips labels in its membership handling. - Scopes: labels reach tokens and narrowed scopes only when the space grant doesn't already cover them, and
labels_inlimits chosen-people spaces to their members.
One thing is worth knowing before merge. Any holder of label can now write !hide and !takedown, where takedown used to be a separate grant. The pull states this, and it follows from the proposal having no per-value grant. The loss of labelling for existing groups until their roles are saved again is also already listed under Shortcomings.
I did not read these files:
- the tests (
protocol.rs,tests/*.rs) - the docs
lib.rs,lexicons.rsandmcp.rsin the host- the opensocial CLI crate and the group-host MCP crate
- the lexicon JSON files and the harness
- the web files
I relied on the pull's description for these.
Nothing has changed in the label code since my approval at 929f840. The new commits are a formatting fix to the lexicon check, a merge of main (which brings in the guides pull), and "The guides give labels and takedowns one permission, label". That last commit changes the guides so they match the folded label action. I didn't read the merged-in guides pull itself, and the guide edits themselves I took from the commit message and haven't read. My earlier points still stand: any holder of label can now write !takedown, and existing groups can't label until their roles are saved again. The pull already lists the second of these under Shortcomings.
Since my approval at 0634e86, the only new content is a merge of main. The merge also changed the console, so that its label and unlabel actions write and delete com.atproto.label.label records as the group, and its Take down uses label. I read those console changes: ReviewDialog.svelte, moderation/+page.server.ts and +page.svelte, ModerationQueue.svelte, actions.ts, activity.ts and moderation.ts. I did not read the rest of the merged-in main, which isn't this pull's change.
- Label and unlabel: a label goes in the subject's own space, or the members space for an account, matching the host's
besiderule. Unlabel lists the group's own records for that subject, keeps those with the sameval, and deletes them in one write. It refuses with "It no longer wears …" when there are none. - Helpers:
asGroup,applyAsGroupandmembersOfall exist inweb/src/lib/asGroup.ts. takedown: it is removed from the console'scanand fromKNOWN, and every use is updated.
One small thing, which doesn't block: unlabel reads at most 100 records for the subject (limit: 100). A subject with more than 100 label records would miss some. That is unlikely in practice.
My earlier points still stand: any holder of label can write !takedown, and existing groups can't label until their roles are saved again. The pull already lists the second under Shortcomings.
What changes
Labels are records written as the group. A label is the proposal's
com.atproto.label.label(uri, optionalcid,val,cts,exp). Apps, the console, the CLI and MCP write it withcom.atproto.space.createRecordand the rest, using a token for the group. It goes beside its subject: a record's label in that record's space, an account's in the members space. The host refuses a label whoseuriis neither a DID nor a record in the space it is written to.fyi.opensocial.applyLabel,negateLabeland thefyi.opensocial.labelrecord are gone.Deleting a label takes it back. There is no
negrecord any more. The queue still keeps both events: alabelEventwhen a label is written, and one withdeleted: truewhen it is deleted, each with who did it.One
labelaction.takedownis folded intolabel, granted byspace:*?collection=com.atproto.label.label, which is the proposal's one grant for writing labels in any group space. A holder writes labels in every space of the group's, except that in a space for chosen people only those of the people who hold it may. A token fromgetGroupAuth, and an app's narrowed scope, carry label writes for holders unless the space's own grant already covers them. Themoderatepermission set, and themetaandmembersspace types, now namecom.atproto.label.label. The host has eleven actions, down from twelve.The console's Review dialog writes the record as the group with a token for the label's space, and takes a label back by deleting each of the group's records of that value on the subject (
listSpaceRecordsbyuri), in oneapplyWrites. Take down and every label's × show to a role withlabel, where main had given takedowns totakedown.mod label/mod_labelwrite and delete the record. They no longer take--rule, which the proposal's record has no field for.The lexicon check matched names by prefix, so
fyi.opensocial.labelercounted as a use offyi.opensocial.label. It now matches whole names.Why
This is the "Labels as the proposal's" item on the open questions issue, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3mzjilmwvs2bn. It was waiting on the proposal to define the record. The proposal now has it as a strawman (
lexicons/com/atproto/label/label.json), with labels written through CRUD and negated by deletion. A collection grant cannot tell!hidefromspam, and the proposal has no takedown grant, sotakedowngoes.Our copy in
lexicons/upstreammakes one change: the proposal renamedcreatedAttoctsbut leftcreatedAtinrequired. As written, no label could be valid, so ours requirescts. That should go back to the proposal.How it was checked
moderation: a label beside a record, and one on an account. Taking a label back by deleting it, and deleting one nobody wrote. Both history events, including those for one version of a record. Refusals for a subject not beside the label, a long value, and a missingcts. Labels needlabel, a single grant covers every value, and writes stop once the role is gone.group_tokensandoauth_scope: tokens and narrowed scopes with labels, without a redundant label scope next tocollection=*.rbac: the actions a label scope grants.mcp(host):mod_labelon an account and on a record, undo, and refusals.protocol(MCP crate): the label plan and where the label goes.commands(CLI):mod label, undo, and its refusals.just lex, clippy, svelte-check,layersanddialogs, andjust docs. The full coverage gate and e2e (the console's "Label someone") are left to CI.moderation,mcp,rbac,group_tokens,oauth_scope, the MCP crate's tests and the CLI'scommandspass; svelte-check,layers,dialogsandjust lexpass. e2e's moderation flow (label, remove, put back, take down) andjust shots --checkare left to CI.Shortcomings
rpc:fyi.opensocial.applyLabelandspace:*?collection=fyi.opensocial.labelin their permissions record. Neither grantslabelnow, so their admins and moderators cannot label until their roles are saved again. Oldfyi.opensocial.labelrecords stay in their spaces, unread.com.atproto.label.labelis still a strawman. If the proposal renames it or changes its fields, this follows.labelandtakedown, so the moderating guide's pictures should not change;just shots --checksays.