version 7 - Design
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- backend
Research direction
This is a version 7 design thread rather than an implementation task, and it names no files, tests, or entry points. Start by reviewing the current 6.x rules engine and the related issues referenced in the discussion; done would require an agreed design for extensibility, structure, Facts, Almanac, Conditions, Rules, and Engine.
Written by the indexing model from the issue text.
Description
Starting a thread here to put notes on a version 7 design.
Version 7 is an opportunity to make a number of changes that have been suggested in issues filed here that would make the JSON rules engine more extensible at the cost of breaking backwards compatibility with the current 6.x versions.
Extensibility vs. Structure
With version 7 we want to consider the tradeoff between extensibility and having a known structure. For instance introducing the ability to add custom Condition classes or custom Rule subclasses allows for the system to be highly extensible but makes it much harder to reason about the input and output of the rules engine without knowing about all these extensions.
Ultimately we need to draw this line somewhere and my initial inclination is to draw it in favor of more extensibility in order to allow the broadest possible use of the rules engine.
Concepts
Starting from a clean stale the following basic concepts will be part of the rules engine
Facts
Facts are things that are known by the rules engine during execution.
Almanac
The Almanac is the system for storing and looking up Facts.
Conditions
Conditions are executable, contain a priority, and return a result containing a boolean value. Generally there are 2 types of conditions, comparison conditions which check the value of a fact against another value, and composite conditions like all, any, and not which use 1 or more nested conditions to produce a result. By being fully extensible it's possible to introduce other types of conditions.
Rules
Rules are also executable and contain a priority. They generally are comprised of a set of conditions which are executed. Rules produce events as a result of execution.
Engine
The engine provides the mechanism to evaluate rules, and conditions. It includes mechanisms to resolve the values of facts or other special objects. Changing the engine can significantly change the behavior of the system.
- Dominant language
- JavaScript
- Stars
- 3.1k
- Forks
- 507
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from CacheControl/json-rules-engine
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
CacheControl/json-rules-engine#427 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
CacheControl/json-rules-engine#424 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
CacheControl/json-rules-engine#421 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
CacheControl/json-rules-engine#417 · 1 reaction ·
All issues in CacheControl/json-rules-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·