ExMaude.AI.ConflictParser (ExMaude v0.2.0)

View Source

Parses Maude conflict-detection output from ai-rules.maude into Elixir structures.

Companion to ExMaude.IoT.ConflictParser. Handles the additional conflict types and the aiConflictSingle constructor (single-rule conflicts like sovereignty violations and approval-gate bypasses).

Maude output format

Maude returns AI conflicts in two shapes:

result AIConflictSet: noAIConflict

result AIConflictSet: aiConflict(toolCallConflict,
  aiRule("rule-1", ...),
  aiRule("rule-2", ...),
  "Same agent, same tool, conflicting required arguments")

result AIConflictSet: aiConflictSingle(sovereigntyViolation,
  aiRule("rule-3", ...),
  "Tool invocation routes through forbidden jurisdiction")

Multiple conflicts are joined with the ||c|| operator:

aiConflict(...) ||c|| aiConflictSingle(...) ||c|| aiConflict(...)

Conflict type mapping

Maude constructorElixir atom
toolCallConflict:tool_call_conflict
capabilityShadowing:capability_shadowing
packToolCompositionMismatch:pack_tool_composition_mismatch
budgetCascade:budget_cascade
costCeilingInfeasibility:cost_ceiling_infeasibility
sovereigntyViolation:sovereignty_violation
authorityEscalation:authority_escalation
approvalGateBypass:approval_gate_bypass
agentLoopCascade:agent_loop_cascade
providerRoutingInfeasibility:provider_routing_infeasibility

Summary

Functions

Parses Maude output to extract AI conflict information.

Types

conflict()

@type conflict() :: %{
  :type => conflict_type(),
  :reason => String.t(),
  :rule1 => String.t(),
  optional(:rule2) => String.t() | nil
}

conflict_type()

@type conflict_type() ::
  :tool_call_conflict
  | :capability_shadowing
  | :pack_tool_composition_mismatch
  | :budget_cascade
  | :cost_ceiling_infeasibility
  | :sovereignty_violation
  | :authority_escalation
  | :approval_gate_bypass
  | :agent_loop_cascade
  | :provider_routing_infeasibility
  | :unknown_conflict

Functions

parse_conflicts(output)

@spec parse_conflicts(String.t()) :: [conflict()]

Parses Maude output to extract AI conflict information.

Returns an empty list if no conflicts are found, or a list of conflict maps. Pairwise conflicts include both :rule1 and :rule2; single-rule conflicts include only :rule1 and a nil :rule2.