MAXIM
Internals
Crate path, key types, adjacent protocols for MAXIM.
MAXIM (Multi-Agent eXecutive Interpretation & Mandate) lives in protocols/maxim-lib. This page covers where to find the implementation, the key Rust types, and how it composes with adjacent protocols.
Source
| Path | Contains |
|---|---|
protocols/maxim-lib/src/lib.rs | ProtocolModule impl, operation dispatch |
protocols/maxim-lib/src/protocol.rs | core protocol logic |
protocols/maxim-lib/src/types.rs | request/response types (derive schemars::JsonSchema) |
protocols/maxim-lib/tests/ | unit + integration tests |
schemas/maxim/v1/ | published JSON Schemas |
ProtocolModule contract
impl ProtocolModule for MaximProtocol {
fn protocol_name(&self) -> &'static str { "MAXIM" }
fn version(&self) -> &'static str { "v1.0.0" }
fn operations(&self) -> Vec<&'static str> {
vec![
"deliberate_dilemma",
"constitutional_interpretation",
"mandate_enforcement",
"health_check",
"metrics",
]
}
async fn invoke(&self, op: &str, payload: Value, ctx: &InvokeContext)
-> Result<Response, ProtocolError>
{
match op {
"deliberate_dilemma" => self.deliberate_dilemma(payload, ctx).await,
"constitutional_interpretation" => self.constitutional_interpretation(payload, ctx).await,
"mandate_enforcement" => self.mandate_enforcement(payload, ctx).await,
"health_check" => self.health_check(payload, ctx).await,
"metrics" => self.metrics(payload, ctx).await,
_ => Err(ProtocolError::UnknownOperation(op.into())),
}
}
}Adjacent
| Relation | Members |
|---|---|
| Consults | — |
| Records to | MAX · MOTET · MOMENT |
| Subject to | MAXIM · MOAT (cross-org) · MOOT (disputes) |
| Settled with | MEAL · MANA · MADE |
Status
Implemented · production-grade.
Tests
cargo test -p maxim-lib --all-featuresSee also
ProtocolModuletrait — the contract- Engine pipeline — the 8 stages
- Plugins — author your own