rule-line documentation
rule-line is a multi-tenant middleware that lets business rules be defined in plain text and executed as versioned, statically-typed JSON rulesets. It is a generic rule engine: documents are an optional capability, not the premise.
What this documentation covers
This is the Phase 1 and Phase 2 reference. It documents the shape of a ruleset document, the contracts the engine enforces at save time, and how an expression or condition evaluates:
- The DSL schema reference — the ruleset document structure, generated directly from the Zod schema the engine actually enforces.
- The diagnostic code catalog — every registered diagnostic code with its description. Codes are the stable contract integrations and tests key off.
- The path conventions — the dot-path used to locate a position in a ruleset document, and the step path used to address a step's position in the tree, each with worked examples.
- The function & operator catalog — every function and condition operator the expression language supports, generated from the closed, typed registry the engine evaluates against, with a name index to jump straight to the entry you need.
- The expression language — the value model, the number model, the failure contract, type discipline, the regular-expression subset, the path grammar, operator precedence and the declared timezone: the rules that are not a per-entry fact.
What it does not yet cover
This documentation describes the document shape, its validation, and expression evaluation. It deliberately says nothing about a ruleset running end to end: no step type executes yet, there is no run model, and there is no trace reference. If you are looking for how a ruleset's steps actually execute and produce a result, that reference does not exist at this stage, by design.