tree_rule
Lists, registers, or removes data-defined validation rules as boolean expressions over tree structure and node parameters, so checks can flag the exact node that breaks a constraint.
Instructions
The tree's checks, as data. No arguments: list the rules. With name +
expr: register one — a boolean expression whose builtins are STRUCTURAL only
(param, nodes, params_of, count, sum/len/abs/min/max, ctx, superseded,
unsupported(p, rel) — how many of what p leans on via rel are superseded
or gone, so a rule can ask whether a claim's supports still stand —
uses/where_used, the reuse folds rollup(under, mult, value) /
tally(under, kind, mult) — mult/value name params, data not schema —
the trace verbs over event subtrees: before(a, b) document order,
preceding/following(p, kind?) earlier/later siblings, index(p),
at(parent, i), parent(p) — so a scenario whose children are events is
checkable ('the confirmation email precedes the charge') — and
and/or/not) plus one bridge to meaning: solve('contract', args…), e.g.
solve('geometry/bbox_h', 'pieces/x'). Contracts come from packages. Scope
with kind (per node of that kind; its params + self in scope) or path;
neither = global. Rules run in tree_check; remove deletes one.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| expr | No | ||
| kind | No | ||
| name | No | ||
| path | No | ||
| remove | No | ||
| description | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |