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

A group defines labels of its own, for moderators to choose and apps to read

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:host/label-definitions

What changes

The host. Two new methods, each for one with group.configure:

  • fyi.opensocial.putLabelDefinition defines one of the group's own labels, or changes the one with that value. It's kept in the group's labeler, as atproto defines a label value:

    • its identifier, lowercase letters and hyphens, so atproto's own !hide and !takedown can't be redefined;
    • its name and what it means, in locales;
    • how apps should show what wears it: severity, blurs, defaultSetting, adultOnly.

    It also adds the value to policies.labelValues, and answers the definition.

  • fyi.opensocial.deleteLabelDefinition removes both. Labels already applied stay.

Each rewrites the labeler record as the group, keeping its other fields. getGroup answers the definitions as labels to whoever may read the meta space.

The command and tools. label define <group> <label> --name --description [--lang] [--severity] [--blurs] [--default-setting] [--adult-only] and label delete <group> <label>, with label_define and label_delete. They're two tools, as rule_set and rule_delete are, because the two take different arguments.

The console.

  • A Labels tab in a group's settings, beside Rules, for those who configure it. Each label shows its name, its value, what it means and how apps show it.
  • Create a label opens a dialog: name, value, what it means, how apps show it, and what they cover. Delete asks first.
  • Review offers the group's labels by name ("Off-topic"), then any other label the group has used, by value.

The Moderating guide gains a section on creating the group's labels, with pictures, and its terminal list names the commands. The design page says what a label definition is and why. The reports look seed defines two.

Why

A label is only a word to an app that doesn't know what it means. The labeler record already had a place for definitions (labelValues, labelValueDefinitions), but nothing here wrote any. A group's labels were whatever a moderator typed, and an app reading them had no way to know what to show.

Host methods rather than writing the record from each client: the record also holds the reports the group takes, so each client would have to read it whole and write it back. Mirroring it whole in getGroup would have meant answering its bare string list (subjectCollections) again, which the lexicon style refuses. The host already holds the record and changes it in place.

How it was checked

  • Host test: defining (defaults and every field), redefining in place, the values list kept beside atproto's, the record's other fields kept, values that aren't the group's refused, a plain member refused, and deleting.
  • Tool test: label_define and label_delete plan the methods with their arguments in the lexicon's names.
  • e2e: the moderation flow now creates a label in settings, sees it offered by name in Review, and deletes it.
  • Here: all 33 e2e flows, clippy, the tests above, just lex and just docs pass. just shots redrew the guides whose pictures show the settings tabs (only the new tab changed) and the Moderating guide.
  • Pictures: drawn with just look (the Labels page with labels and empty, its dialog, Review offering them). A fresh agent critiqued them. Fixed from it: "Define" became "Create" (the house verb for a new thing that is then listed); riddling field names became "How apps show it" and "What apps cover"; Review's colon line became a sentence; rows now have one quiet line, as Rules' do.

The coverage gate is left to CI.

Shortcomings

  • No app here reads the definitions yet. The host doesn't publish the group as a Bluesky labeller, so Bluesky's apps see none of these labels. Opensocial apps reading fyi.opensocial.labeler are the audience.
  • A definition's name and description are in one language, en unless --lang is given. The console asks none.
  • The console doesn't edit a label in place. Creating one with the same value replaces it.
  • severity is always inform from the console. The command takes it.

🤖 Generated with Claude Code

labels-alice-desktop-light.png

moderating-define-dialog.png

empty-alice-desktop-light.png

moderating-label-dialog.png

labels-alice-phone-dark.png

Approved

This adds putLabelDefinition and deleteLabelDefinition, which keep a group's label definitions in its labeler record. It also adds labels on getGroup, the label define and label delete commands with their tools, a Labels settings tab, and docs. The host logic is sound. The label is checked as lowercase letters and hyphens, so !hide and !takedown can't be redefined. The labeler is rewritten whole, so its other fields are kept. group.configure is required. The labeler record is created with the group, so Write::Update has a record to update. I read the host, lexicon, MCP and command changes. I did not read the web, e2e, test or docs files, or the screenshot files.

Two small points, neither blocking:

  • severity, blurs and defaultSetting are knownValues, so the lexicon doesn't reject other strings. put_label_definition copies whatever string arrives into the labeler record. A typo through the CLI or MCP would be stored and served as a definition other apps can't read. Consider refusing values outside the three lists in moderation.rs.
  • The read-modify-write of the labeler isn't guarded against two concurrent calls. It's low risk for a settings action.
Merged as b2ea25e