Skip to main content

Type Alias: PolicyNode

type PolicyNode =
| {
kind: "attr";
name: string;
}
| {
children: PolicyNode[];
kind: "op";
op: "and" | "or";
};

Defined in: policy.ts:14

The attribute-policy language and its normalizer.

DocStack's one access-control language (ADR-0045, spec 02 §1): quoted attributes composed with and/or and parentheses — monotone by construction, no negation, no data-dependence. This module is the ONLY path a policy string takes into the ABE layer: rabe's MSP converter panics on unparenthesized AND-chains of length ≥ 3 (characterized in spikes/abe/bench/rabe-probe.ts), so every formula is parsed here and re-emitted as a fully parenthesized, BALANCED binary tree before it reaches the scheme. Authors write formulas naturally; the wire form is canonical.