Skip to main content

Module deontic_logic

Module deontic_logic 

Source
Expand description

Deontic logic engine — ODRL-based policy evaluation for credential-gated subgraph access.

The policy hierarchy maps agent Verifiable Credentials to SubgraphLayer access rights. Policy evaluation is:

  1. Extract VcAttributes from the agent’s NQuin slice (credential claims).
  2. Evaluate against the SubgraphPolicy for the requested layer.
  3. If the policy passes, call KeyVault::generate_layer_key() and return it.

The deontic_logic module is intentionally free of heap allocation in evaluation paths — all structures fit in fixed-size arrays.

Modules§

vc_roles
Compile-time hashes of canonical ODRL/Qualia role IRIs used in VC claims.

Structs§

VcAttributes
Parsed Verifiable Credential attributes for a single agent.

Enums§

DeonticResult
The result of a deontic policy evaluation for subgraph key release.

Functions§

compile_n3_rule_to_norm
Compile an N3 rule into a norm Quin (or a defeater Quin if rule_type is Defeater).
evaluate_accessible_layers
Convenience: evaluate which layers the agent can access and write the permitted keys into out, in ascending layer order.
evaluate_vc_for_subgraph_key_release
Evaluate an agent’s VCs against the ODRL policy for layer and, if permitted, return the derived SubgraphKey.
write_vc_claim_quins
Build the NQuins that record a VC credential claim for an agent, for insertion into the daemon graph.