Release notes
RuleWright follows semantic versioning. Before 1.0, a minor version may contain a breaking change, and each one is called out here. The complete, detailed history is CHANGELOG.md in the repository.
Unreleased
These are in the source this site documents, and will ship in the next release.
Added
- Scoped params.
paramson a rule set (global) or a rule (local, shadowing) names an expression once;{ "param": "…" }references it anywhere an expression is valid. References are inlined at load, cycles and unknown names are pointer-addressed validation errors. See Scoped params. - Value functions.
RegisterValueFunctionplus the{ "call": …, "operands": […] }expression node: registered C# computations callable from action values, computed left-hand sides and decision-table cells. Unknown names — and wrong operand counts, when the function declares a required count viaIRuleValueFunctionMetadata— fail atLoadRuleSet. See Value functions. - Custom actions.
RegisterAction(name, handler)adds action types beyond the built-in four; the handler'sRuleActionContextreads and writes the running outputs on both execution paths, and validation folds registered names into the closed vocabulary (RuleSetValidator.ValidateandRuleSetParser.ParsegainedRuleDocumentOptionsoverloads). See Custom actions. - Failure messages. A rule's
failureMessagesurfaces onRuleEvaluationResult.Failureswhen the rule is evaluated and its condition doesn't hold. See Rule sets. - Named multi-fact evaluation.
RuleFacts.With("customer", c).And("order", o)evaluates several named facts as one, each addressed by its name as the first path segment. See Typed and dictionary facts. - Rule-set composition.
RuleSet.Merge(sets, name, stopAfterFirstMatch)combines sets at load time, with duplicate rule ids failing loudly. See Build rules in C#. - Engine discovery for the new registrations.
RegisteredValueFunctions,ValueFunctionCatalogandRegisteredActions, beside the existing function catalog. See Discover the vocabulary. - Four new example documents (22–25), and the JSON Schema now describes
params,failureMessageand thecall/paramexpression nodes. - Case-insensitive JSON facts, opt-in.
SystemTextJsonFacts.ToDictionary(element, keyComparer)andNewtonsoftJsonFacts.ToDictionary(token, keyComparer)build every level of a fact with the comparer you give, soStringComparer.OrdinalIgnoreCaseletsOrder.Totalmatch camelCase JSON. Keys that collide under the comparer throwArgumentException. The one-argument overloads are unchanged. See Typed and dictionary facts.
Fixed (documentation)
- The first two examples in the repository's
usage.mdused facts whose shape didn't match their rules.
0.3.0
The first release since 0.1.1. It includes everything listed for 0.2.0, which was never published.
Important
Breaking: Rulewright is now RuleWright everywhere: package ids, assembly names and namespaces. using Rulewright.Core; becomes using RuleWright.Core;, and because the assembly names changed, you must recompile. Rule documents are unchanged.
Added
- Collection quantifiers
Any,AllandNone, with"$"for the element itself, and thecountexpression operator. See Collections. ConditionLeaf.Quantifier(...),ConditionLeaf.ElementCondition,OperatorValueKind.Condition,ConditionOperatorInfo.RequiresElementConditionandExpressionOperatorCategory.Collection.stopAfterFirstMatchon a rule-set document. See Rule sets.
Fixed
countwas described ascoalescein traces. Evaluation was never affected.- The published JSON Schema rejected
stopAfterFirstMatch.
0.2.0 (not published; shipped in 0.3.0)
Breaking changes
- Unknown properties are errors. A misspelled key such as
"actons"used to be ignored, producing a rule that fired and wrote nothing. Documents with extra keys that used to load are now rejected. EvaluationOptionsis immutable. Set it with an object initializer. Assigning a property after construction no longer compiles, andEvaluationOptions.Defaultcan't be changed.firstdecision tables expand differently. Each row's condition is now exactly its cells, and the set getsStopAfterFirstMatch. Behaviour is unchanged, and a 500-row table no longer takes seconds to compile.
Added
RuleSkipReasonandRuleTrace.SkipReason, separating a disabled rule from one never reached after a match.RuleSet.StopAfterFirstMatch.- Traces describe a computed left-hand side as the expression itself.
Fixed
In/NotInagree on both paths when the array containsnull(and the validator now rejects one).IsInPast/IsInFutureresolve both sides to UTC, so results no longer depend on the server's time zone.- A condition node reused within one tree no longer crashes the load.
addToOutputonto a non-numeric value leaves it alone instead of replacing it withnull.- A document with both
decisionTableandrulesis a validation error, instead of silently droppingrules. - An out-of-range number such as
1e400is aRuleParseExceptionon every target framework. - Malformed operands, regex patterns and function names in rules built in C# are checked at
LoadRuleSet. - A fact whose static type is
object, or which implements onlyIReadOnlyDictionary<string, object>, now evaluates, through the interpreter. - A decision-table
MatchesRegexcell with an invalid pattern is a validation error.
0.1.1
The first public packages: the domain model, parsing and validation, the compiled engine, the System.Text.Json and Newtonsoft.Json adapters, the built-in functions, and the RuleWright metapackage.