···1111/// Takes the content, user preferences, labeler definitions, and list of accepted labelers,
1212/// and produces a moderation decision indicating what actions to take.
1313///
1414-/// # Arguments
1515-///
1616-/// * `item` - The content to moderate
1717-/// * `prefs` - User's moderation preferences
1818-/// * `defs` - Labeler definitions describing what labels mean
1919-/// * `accepted_labelers` - Which labelers to trust (usually from CallOptions)
2020-///
2114/// # Example
2215///
2316/// ```ignore
+1-45
crates/jacquard/src/moderation/fetch.rs
···77use jacquard_common::types::string::Did;
88use jacquard_common::xrpc::{XrpcClient, XrpcError};
991010-/// Fetch labeler definitions from app.bsky.labeler.getServices
1111-///
1212-/// This is a convenience helper for fetching labeler service records from Bluesky's
1313-/// labeler service. You can also fetch these from other indexes or sources and
1414-/// construct a `LabelerDefs` manually.
1515-///
1616-/// # Arguments
1717-///
1818-/// * `client` - Any XRPC client (Agent, stateless client, etc.)
1919-/// * `dids` - List of labeler DIDs to fetch definitions for
2020-///
2121-/// # Example
2222-///
2323-/// ```no_run
2424-/// # use jacquard::moderation::fetch_labeler_defs;
2525-/// # use jacquard::client::BasicClient;
2626-/// # use jacquard_common::types::string::Did;
2727-/// # #[tokio::main]
2828-/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
2929-/// let client = BasicClient::unauthenticated();
3030-/// let labeler_did = Did::new_static("did:plc:ar7c4by46qjdydhdevvrndac").unwrap();
3131-/// let defs = fetch_labeler_defs(&client, vec![labeler_did]).await?;
3232-/// # Ok(())
3333-/// # }
3434-/// ```
1010+/// Fetch labeler definitions from Bluesky's AppView (or a compatible one)
3511pub async fn fetch_labeler_defs(
3612 client: &(impl XrpcClient + Sync),
3713 dids: Vec<Did<'_>>,
···8561/// This fetches the `app.bsky.labeler.service` record directly from the PDS where
8662/// the labeler is hosted.
8763///
8888-/// # Arguments
8989-///
9090-/// * `client` - Any XRPC client with fetch_record support (Agent, etc.)
9191-/// * `dids` - List of labeler DIDs to fetch definitions for
9292-///
9393-/// # Example
9494-///
9595-/// ```no_run
9696-/// # use jacquard::moderation::fetch_labeler_defs_direct;
9797-/// # use jacquard::client::BasicClient;
9898-/// # use jacquard::prelude::*;
9999-/// # use jacquard_common::types::string::Did;
100100-/// # #[tokio::main]
101101-/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
102102-/// # let client = BasicClient::unauthenticated();
103103-/// let labeler_did = Did::new_static("did:plc:ar7c4by46qjdydhdevvrndac").unwrap();
104104-/// let defs = fetch_labeler_defs_direct(&client, vec![labeler_did]).await?;
105105-/// # Ok(())
106106-/// # }
107107-/// ```
10864pub async fn fetch_labeler_defs_direct(
10965 client: &(impl AgentSessionExt + Sync),
11066 dids: Vec<Did<'_>>,
+1-1
crates/jacquard/src/moderation/tests.rs
···707707 // Use the Moderateable trait with empty accepted_labelers to trust all labels
708708 let decisions = labeled_post.moderate_all(&prefs, &defs, &[]);
709709710710- println!("Moderateable decisions for labeled post:");
710710+ println!("Moderation decisions for labeled post:");
711711 for (tag, decision) in &decisions {
712712 if !decision.causes.is_empty() {
713713 println!(