@orkestrel/reason 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @orkestrel/reason
2
2
 
3
- A zero-dependency, synchronous, deterministic **reasoning engine**: declarative,
3
+ A synchronous, deterministic **reasoning engine**: declarative,
4
4
  JSON-serializable **definitions** are evaluated against **subjects** (plain
5
5
  data records) to produce traceable **results**. Four strategies behind one
6
6
  dispatch surface — `quantitative` (factor-based numeric scoring), `logical`
@@ -22,27 +22,27 @@ npm install @orkestrel/reason
22
22
 
23
23
  ## Requirements
24
24
 
25
- - Node.js >= 24
25
+ - Node.js >= 22.12.0, matching the package engine declaration
26
26
  - ESM-only (no CommonJS build)
27
27
 
28
28
  ## Usage
29
29
 
30
30
  ```ts
31
31
  import {
32
+ createFactorGroup,
33
+ createFieldFactor,
34
+ createQuantitativeDefinition,
32
35
  createQuantitativeReasoner,
33
36
  createReason,
34
- factorGroup,
35
- fieldFactor,
36
- quantitativeDefinition,
37
- staticFactor,
37
+ createStaticFactor,
38
38
  } from '@orkestrel/reason'
39
39
 
40
40
  const reason = createReason({ reasoners: [createQuantitativeReasoner()] })
41
41
 
42
- const definition = quantitativeDefinition('risk', 'Risk score', [
43
- factorGroup('drivers', 'sum', [
44
- fieldFactor('age', 'age'), // reads subject.age, parseNumber-coerced
45
- staticFactor('floor', 10), // a fixed contribution
42
+ const definition = createQuantitativeDefinition('risk', 'Risk score', [
43
+ createFactorGroup('drivers', 'sum', [
44
+ createFieldFactor('age', 'age'), // reads subject.age, parseNumber-coerced
45
+ createStaticFactor('floor', 10), // a fixed contribution
46
46
  ]),
47
47
  ])
48
48
 
@@ -62,7 +62,7 @@ the discriminant and read the strategy-specific payload (`value` /
62
62
  For the full surface — the orchestrator, the four reasoners, the three
63
63
  operators, the definitions & subjects capability layer, the two workspace
64
64
  builders (`DefinitionBuilder` / `SubjectBuilder`), validators, errors, and the
65
- observation surface — see [`guides/src/reason.md`](guides/src/reason.md).
65
+ observation surface — see [`guides/reason.md`](guides/reason.md).
66
66
 
67
67
  ## Package
68
68