Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom label definitions and tune various behaviors #2237

Merged
merged 17 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions lexicons/app/bsky/actor/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"properties": {
"lists": { "type": "integer" },
"feedgens": { "type": "integer" },
"modservice": { "type": "boolean" }
"labeler": { "type": "boolean" }
}
},
"viewerState": {
Expand Down Expand Up @@ -134,6 +134,11 @@
"type": "object",
"required": ["label", "visibility"],
"properties": {
"labelerDid": {
"type": "string",
"description": "Which labeler does this preference apply to? If undefined, applies globally.",
"format": "did"
},
"label": { "type": "string" },
"visibility": {
"type": "string",
Expand Down Expand Up @@ -297,20 +302,11 @@
},
"modPrefItem": {
"type": "object",
"required": ["did", "enabled"],
"required": ["did"],
"properties": {
"did": {
"type": "string",
"format": "did"
},
"enabled": {
"type": "boolean"
},
"disabledLabelGroups": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lexicons/app/bsky/embed/record.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"#viewBlocked",
"app.bsky.feed.defs#generatorView",
"app.bsky.graph.defs#listView",
"app.bsky.moderation.defs#modServiceView"
"app.bsky.labeler.defs#labelerView"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,92 +1,67 @@
{
"lexicon": 1,
"id": "app.bsky.moderation.defs",
"id": "app.bsky.labeler.defs",
"defs": {
"modServiceView": {
"labelerView": {
"type": "object",
"required": ["uri", "cid", "creator", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#modServiceViewerState" },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"modServiceViewDetailed": {
"labelerViewDetailed": {
"type": "object",
"required": ["uri", "cid", "creator", "policies", "indexedAt"],
"properties": {
"uri": { "type": "string", "format": "at-uri" },
"cid": { "type": "string", "format": "cid" },
"creator": { "type": "ref", "ref": "app.bsky.actor.defs#profileView" },
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"policies": {
"type": "ref",
"ref": "app.bsky.moderation.defs#modServicePolicies"
"ref": "app.bsky.labeler.defs#labelerPolicies"
},
"likeCount": { "type": "integer", "minimum": 0 },
"viewer": { "type": "ref", "ref": "#modServiceViewerState" },
"viewer": { "type": "ref", "ref": "#labelerViewerState" },
"indexedAt": { "type": "string", "format": "datetime" },
"labels": {
"type": "array",
"items": { "type": "ref", "ref": "com.atproto.label.defs#label" }
}
}
},
"modServiceViewerState": {
"labelerViewerState": {
"type": "object",
"properties": {
"like": { "type": "string", "format": "at-uri" }
}
},
"modServicePolicies": {
"labelerPolicies": {
"type": "object",
"required": ["reportReasons", "labelValues"],
"required": ["labelValues"],
"properties": {
"description": {
"type": "string",
"maxGraphemes": 10000,
"maxLength": 100000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"reportReasons": {
"labelValues": {
"type": "array",
"description": "The label values which this labeler publishes. May include global or custom labels.",
"items": {
"type": "ref",
"ref": "com.atproto.moderation.defs#reasonType"
"ref": "com.atproto.label.defs#labelValue"
}
},
"labelValues": {
"labelValueDefinitions": {
"type": "array",
"description": "Label values created by this labeler and scoped exclusively to it. Labels defined here will override global label definitions for this labeler.",
"items": {
"type": "ref",
"ref": "com.atproto.label.defs#labelValue"
"ref": "com.atproto.label.defs#labelValueDefinition"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
{
"lexicon": 1,
"id": "app.bsky.moderation.getServices",
"id": "app.bsky.labeler.getServices",
"defs": {
"main": {
"type": "query",
"description": "Get information about a list of moderation services.",
"description": "Get information about a list of labeler services.",
"parameters": {
"type": "params",
"required": ["dids"],
"properties": {
"dids": {
"type": "array",
"items": { "type": "string", "format": "did" }
},
"detailed": {
"type": "boolean",
"default": false
}
}
},
Expand All @@ -24,8 +28,11 @@
"views": {
"type": "array",
"items": {
"type": "ref",
"ref": "app.bsky.moderation.defs#modServiceView"
"type": "union",
"refs": [
"app.bsky.labeler.defs#labelerView",
"app.bsky.labeler.defs#labelerViewDetailed"
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
{
"lexicon": 1,
"id": "app.bsky.moderation.service",
"id": "app.bsky.labeler.service",
"defs": {
"main": {
"type": "record",
"description": "A declaration of the existence of moderation service.",
"description": "A declaration of the existence of labeler service.",
"key": "literal:self",
"record": {
"type": "object",
"required": ["policies", "createdAt"],
"properties": {
"description": {
"type": "string",
"maxGraphemes": 300,
"maxLength": 3000
},
"descriptionFacets": {
"type": "array",
"items": { "type": "ref", "ref": "app.bsky.richtext.facet" }
},
"policies": {
"type": "ref",
"ref": "app.bsky.moderation.defs#modServicePolicies"
"ref": "app.bsky.labeler.defs#labelerPolicies"
},
"labels": {
"type": "union",
Expand Down
24 changes: 0 additions & 24 deletions lexicons/app/bsky/moderation/getService.json

This file was deleted.

70 changes: 52 additions & 18 deletions lexicons/com/atproto/label/defs.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,57 @@
}
}
},
"labelValueDefinition": {
"type": "object",
"description": "Declares a label value and its expected interpertations and behaviors.",
"required": ["identifier", "severity", "blurs", "locales"],
"properties": {
"identifier": {
"type": "string",
"description": "The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).",
"maxLength": 100,
"maxGraphemes": 100
},
"severity": {
"type": "string",
"description": "How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.",
"knownValues": ["inform", "alert", "none"]
},
"blurs": {
"type": "string",
"description": "What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.",
"knownValues": ["content", "media", "none"]
},
"locales": {
"type": "array",
"items": { "type": "ref", "ref": "#labelValueDefinitionStrings" }
}
}
},
"labelValueDefinitionStrings": {
"type": "object",
"description": "Strings which describe the label in the UI, localized into a specific language.",
"required": ["lang", "name", "description"],
"properties": {
"lang": {
"type": "string",
"description": "The code of the language these strings are written in.",
"format": "language"
},
"name": {
"type": "string",
"description": "A short human-readable name for the label.",
"maxGraphemes": 64,
"maxLength": 640
},
"description": {
"type": "string",
"description": "A longer description of what the label means and why it might be applied.",
"maxGraphemes": 10000,
"maxLength": 100000
}
}
},
"labelValue": {
"type": "string",
"knownValues": [
Expand All @@ -75,24 +126,7 @@
"sexual",
"nudity",
"nsfl",
"corpse",
"gore",
"torture",
"self-harm",
"intolerant-race",
"intolerant-gender",
"intolerant-sexual-orientation",
"intolerant-religion",
"intolerant",
"icon-intolerant",
"threat",
"spoiler",
"spam",
"account-security",
"net-abuse",
"impersonation",
"scam",
"misleading"
"gore"
]
}
}
Expand Down
Loading
Loading