Metakit / API

@doeixd/metakit/policy

Declarative authorization policies (@doeixd/metakit/policy, browser & server safe).

Keeps authority ({ row, principal }) strictly scoped apart from data validity (row invariants): Policy rules can read both row and principal, while Schema invariants can never reference principal.

Supports runtime allow, partial-evaluation can (for UI/agent hints), and synchronous Tier 3 Zone checks (checkImplication, checkConsistent). For Tier 4 Z3 escalation and counterexample witnesses, pass a Policy to Prove.policyImplies or Prove.policyConsistent in @doeixd/metakit/prove.

Functions

checkConsistentTier 3 synchronous check: is rule, one of policy.rules, provably dead (unsatisfiable under the row and principal schema invariants)?
checkImplicationTier 3 synchronous check: does rule from of policy (together with row and principal schema invariants) entail its rule to?
makeConstruct a typed authorization Policy over { row, principal }.

Interfaces

DefinitionThe facts a checker consumes. Only the policy evaluator needs concrete principal decisions.
Policy
PolicyEnv

Types

RuleOfAny one rule of a policy whose rules are R.
RulesThe rules of a policy as it holds them: each a new expression over the node of the rule it was given, carrying its key as name.