Metakit / @doeixd/metakit/policy

checkConsistent

function · packages/metakit/src/policy.ts:205

function checkConsistent<
  Row,
  Principal,
  Rules extends Readonly<
    Record<string, Expr.Expr<PolicyEnv<Row, Principal>, boolean>>
  >,
>(
  policy: Definition<Row, Principal, Rules>,
  rule: NoInfer<RuleOf<Rules>>,
): Verdict.Verdict<never>

Tier 3 synchronous check: is rule, one of policy.rules, provably dead (unsatisfiable under the row and principal schema invariants)?

Returns Verdict.False when the rule is provably unsatisfiable (dead allow rule), or Verdict.Unknown otherwise (use Prove.policyConsistent for a concrete satisfying witness or Z3 unsatisfiability proof). A rule of another policy throws.