Expand description
Assembling every source into one didbot_policy::PolicyTree.
§No precedence engine, and none is needed
plan/policy.md: “All three deny; none can permit what another denies,
so their order is a matter of where a policy is written and not of what
it can do.” build registers builtin, then startup, then
operator-sourced policies, in that fixed order – and each source’s own
records ordered by id within it – but nothing about the
verdict a write receives depends on that order, only on which reason
didbot_policy::combine reports when more than one policy denies the
same write. Deny-only monotonicity is what makes this true: adding a
policy from any source can only hold a verdict steady or make it more
severe, never less, so there is no shadowing between sources and nothing
for a precedence engine to arbitrate. The fixed order here exists only
so a report is reproducible, not because it changes what is enforced.
Structs§
- Last
Good Fallback - One id whose current revision would not compile, still enforced at the
last revision that did –
plan/policy.md’s “was working, new revision will not compile” state, told apart from a first-publish typo (which stays a plainScopedDenial, with nothing to fall back to) precisely by this type existing for it. Seecrate::last_good’s doc comment. - Load
Report - Everything worth telling an operator about a tree build: which
operator-or-startup-sourced records could not be compiled (scoped-deny,
per
crate::compile), which compiled with a warning, which fell back to a last-good revision, and which records were not policies at all, reported by whichever source loaded them.
Functions§
- build
- Build the full
PolicyTreefrom every source. - by_id 🔒
- One source’s records in a fixed order: by id, ascending.