feat: ChainRule condition steps — rule-based final hops for chains
CI / publish (push) Has been skipped
CI / test (push) Successful in 5m43s
CI / benchmark (push) Successful in 35s

A chain step of the form { rule: <config>, conditionStep: true } is a
condition-gated hop instead of an edge traversal. It is valid only as the
FINAL step: the object is known, so the engine verifies the referenced rule
at (intermediate, object) for each current path. Enables a chain's object-side
hop to reference a defeasible/logical evidence (e.g.
member_of(user,*g){ gated(g,doc) } where gated is WHEN/UNLESS).

- RuleEvaluator wires the ChainRule with itself so condition steps can
  evaluate sub-rules recursively.
- ChainRule constructor accepts the ruleEvaluator; the traversal loop handles
  a final condition step (min-combined possibility, reliability product,
  threshold respect). Non-final condition steps return condition_step_not_final.
- The rule config is part of the chain cache key (JSON.stringify of steps).

Tests: chain-condition-step (grant/deny/missing-edge/non-final/parallel-max).
This commit is contained in:
John Dvorak
2026-08-03 12:00:16 -07:00
parent aa4ceff30c
commit 4da3158c63
4 changed files with 161 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@arbiter/core",
"version": "1.0.2",
"version": "1.0.3",
"description": "Arbiter core engine: graph indices, relation/reachability, authorization rule evaluator, DSL/AST, condensed & sharded snapshots, and evidence fusion.",
"license": "ISC",
"author": "",