openvet-policy
Requirement language and Kleene evaluator for OpenVet.
Given a TOML-defined policy and the audits collected for a single
subject across all configured logs, returns a Pass / Fail verdict
with structured per-requirement diagnostics.
TOML shape
# Bare form: default-on requirement, value is the expression.
[]
= "safe-to-deploy and not unsafe-code"
# Table form: opt-in by overriding into the requirement set.
[]
= "sandboxed"
= false
# Per-subject overrides. Matcher fields are AND'd; "*" / omitted = wildcard.
[[]]
= "cargo"
= "libc"
= { = ["sandbox"], = ["safe-to-deploy"] }
[[]]
= "serde"
= ["safe-to-deploy"] # replace form
# Cross-log claim renames: "log:claim" → canonical name.
[]
= ["google:safe-to-run", "mozilla:runtime-safe"]
Evaluation
Three-valued logic per audit (True, False, Unknown) with standard
short-circuiting (False short-circuits and, True short-circuits
or, not Unknown == Unknown).
A requirement passes for a subject iff at least one audit returns
True and no audit returns False. Fail variants distinguish
"nobody had enough info" (NotAsserted) from "an audit explicitly
disagrees" (Contradicted), and the latter includes a snapshot of the
relevant claims so the failure message can show why.
A subject passes iff all of its effective requirements pass.
use ;
let policy = parse_str?;
let verdict = evaluate;
println!;
# Ok::