MAP Docs
MERIT

Internals

Crate path, key types, adjacent protocols for MERIT.

MERIT (Moral Evaluation, Reputation & Integrity Tracking) lives in protocols/merit-lib. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols.

Source

PathContains
protocols/merit-lib/src/lib.rsProtocolModule impl, operation dispatch
protocols/merit-lib/src/protocol.rscore protocol logic
protocols/merit-lib/src/types.rsrequest/response types (derive schemars::JsonSchema)
protocols/merit-lib/tests/unit + integration tests
schemas/merit/v1/published JSON Schemas

ProtocolModule contract

impl ProtocolModule for MeritProtocol {
    fn protocol_name(&self) -> &'static str { "MERIT" }
    fn version(&self) -> &'static str { "v1.0.0" }

    fn operations(&self) -> Vec<&'static str> {
        vec![
            "evaluate_ethics",
            "get_policy",
            "update_policy",
        ]
    }

    async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext)
        -> Result<Response, ProtocolError>
    {
        match op {
            "evaluate_ethics" => self.evaluate_ethics(payload, ctx).await,
            "get_policy" => self.get_policy(payload, ctx).await,
            "update_policy" => self.update_policy(payload, ctx).await,
            _ => Err(ProtocolError::UnknownOperation(op.into())),
        }
    }
}

Adjacent

RelationMembers
Consults
Records toMAX · MOTET · MOMENT
Subject toMAXIM · MOAT (cross-org) · MOOT (disputes)
Settled withMEAL · MANA · MADE

Status

Implemented · production-grade.

Tests

cargo test -p merit-lib --all-features

See also

On this page