Rule Cascade
Usage by language

Usage by language

Which runtime to use where, the versions each one supports, and the calls every runtime has in common.

Every runtime implements the same specification and passes the same conformance suite. Pick the one that runs where the decision is made.

RuntimeUse it inPage
TypeScriptBrowsers, Node.js, React, React Native, ElectronTypeScript
JavaSpring Boot and any JVMJava
GoGo servicesGo
PythonServices, jobs and tooling; the reference implementationPython
Command, WebAssembly moduleAny other language, CI scripts, sandboxesCommand and WebAssembly
Rule serverCallers that should not run an engine, over HTTPRule server

Supported versions

The minimums are declared by each package. CI tests the versions in the last column on every push. No maximum is declared: newer versions are expected to work, but only the tested ones are proven.

RuntimeDeclared minimumWhere it is declaredTested in CI
TypeScript, rule serverNode.js 20engines in packages/typescript/package.json and packages/server/package.jsonNode.js 20 (Linux), 22 (Linux, Windows, macOS)
JavaJava 17maven.compiler.release in packages/java/pom.xmlJDK 17 and 21 (Linux), 21 (Windows, macOS)
GoGo 1.22go directive in packages/go/go.modGo 1.24 (Linux, Windows, macOS)
PythonPython 3.10requires-python in packages/python/pyproject.tomlPython 3.10 (Linux), 3.12 (Linux, Windows, macOS)
WebAssembly moduleA WASI preview 1 hostGOOS=wasip1 buildNode.js 22 and wasmtime (Python)

The same calls everywhere

StepTypeScriptJavaGoPython
Read a compiled bundleRuleSet.fromBundle(json)RuleSet.fromBundle(map)rulecascade.FromBundle(json)RuleSet.from_bundle(json)
Compile a source rulesetloadRuleSet(document, registry, options)RuleSet.load(document, registry, schemaLoader)rulecascade.Load(document, registry, loader)load(document, registry, loader)
Evaluaterules.evaluate(request, channel?, operators?)rules.evaluate(EvaluationRequest)rules.Evaluate(request, channel, operators)rules.evaluate(request, channel="server", operators=None)
Load errorLoadError (.problems, .codes)LoadException (problems(), codes())*rulecascade.LoadError (.Problems)LoadError (.problems, .codes)
Malformed requestRequestErrorIllegalArgumentException*rulecascade.RequestErrorValueError (RequestError)
Operators a manifest needsmissingOperators(manifest, operators)rules.requiredOperators(Channel.SERVER)operators of rules.Manifest("server")rules.manifest("server")["operators"]

Two kinds of failure are deliberately different:

  • A load error means the ruleset or bundle must not be served. Let it stop the process at start-up.
  • A rule that cannot be evaluated never throws. It produces a blocking finding with code RULE-EVALUATION-ERROR and the decision deny. See Incident: RULE-EVALUATION-ERROR spike.

Installing from the repository

The packages are not published to a registry yet. Every page installs from a checkout:

git clone https://github.com/YarlisAISolutions/rule-cascade.git

Pin the checkout to a commit or tag in your build, the same way you would pin a registry version.

Source: site/content/docs/usage/index.mdx

On this page