Expand description
The applicability index: the tree that turns a subject into an ordered list of candidate policies.
plan/policy.md: “The tree indexes; the list evaluates […] a write
matching nothing has paid only for a walk it already owed.” Two
independent trees are built per subject shape — one from each policy’s
decision applicability, one from its observation surface — because a
policy can be told about an attempt without being asked to decide it.
Structs§
- Client
Index 🔒 - The index for a subject keyed on its client alone: a grant or a token.
- Collection
Trie 🔒 - One collection’s trie, plus the action and account-kind filters each
entry was declared with. Both are indexed in parallel with a
synthetic per-policy mask recorded at insertion — kept as side tables
rather than inline in
PathNodeso the trie stays generic over “a policy matched here” and each filter test stays one lookup, not a scan. - Path
Node 🔒 - A trie over changed-path segments, as
segmentssplits them. - Policy
Tree - The built applicability index: every registered policy’s predicate, and the decision and observation trees to route a subject through.
- Policy
Tree Builder - Builds a
PolicyTreefrom a set of evaluators and the policies that use them. - Shape
Index 🔒 - The pair of trees every subject is routed through: decision and observation.
- Trees 🔒
- One tree per subject shape.
- Write
Index 🔒 - The write-subject index: collection, then changed path, then action.
Functions§
- segments 🔒
- Split one path into the segments this index routes on:
.separates them, and an[index]subscript is a segment of its own rather than part of the field name it follows.