@cfxlabsinc/b2b-services
    Preparing search index...
    ExplainNode:
        | { kind: "always"; result: true }
        | {
            children: ExplainNode[];
            combinator: RuleGroup["combinator"];
            kind: "group";
            result: boolean;
        }
        | {
            actual: unknown;
            field: RuleCondition["field"];
            kind: "condition";
            operator: RuleCondition["operator"];
            result: boolean;
            value?: unknown;
        }

    One node of an evaluated matcher tree: the rule's own shape, with each node's verdict and — at the leaves — the criteria value it was judged against.

    actual is what turns a FAIL into a diagnosis rather than a restatement: "organizationId is org_MAIN — FAIL (org_SUB)" names the problem, "FAIL" does not. undefined means the field was absent from the criteria entirely, which is a distinct and common cause (every comparison operator carries its own existence check, so an absent field fails both is and is_not).

    Deliberately carries no "first failing node" marker — which node to highlight is a presentation decision, derived by the renderer, not part of the evaluation record.

    Type Declaration

    • { kind: "always"; result: true }
    • {
          children: ExplainNode[];
          combinator: RuleGroup["combinator"];
          kind: "group";
          result: boolean;
      }
    • {
          actual: unknown;
          field: RuleCondition["field"];
          kind: "condition";
          operator: RuleCondition["operator"];
          result: boolean;
          value?: unknown;
      }
      • actual: unknown

        The criteria value evaluated against; undefined when absent.

      • field: RuleCondition["field"]
      • kind: "condition"
      • operator: RuleCondition["operator"]
      • result: boolean
      • Optionalvalue?: unknown

        The rule's expected value; absent for is_set / is_not_set.