@orkestrel/qualifier 0.0.12 → 0.0.14

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,13 +1,18 @@
1
1
  # @orkestrel/qualifier
2
2
 
3
- A typed **eligibility engine** over [`@orkestrel/reason`](https://github.com/orkestrel/reason):
4
- authored **passes** — quantitative derivations and logical rule gates — run in order
5
- against a **subject** (a plain data record) to produce **findings** (evidence-rich
6
- ruling outcomes), **derivations** (quantitative audit trails), and **eligibility**
7
- (global plus per-scope). The caller supplies the definition; `Qualifier` only
8
- evaluates what it is given. Qualification never mutates its inputs — every result is
9
- a fresh object. Environment-agnostic — no I/O, no browser or server assumptions.
10
- Part of the `@orkestrel` line.
3
+ > A synchronous, deterministic eligibility engine that runs a pure,
4
+ > JSON-serializable `QualificationDefinition`'s ordered `passes` against one
5
+ > subject through one `@orkestrel/reason` engine and returns a fresh
6
+ > `QualificationResult` carrying global and scoped eligibility, evidence-rich
7
+ > `findings`, and quantitative `derivations`.
8
+
9
+ Author the passes — quantitative derivations and logical rule gates — hand a subject
10
+ (a plain data record) to `qualify`, and read what comes back. The caller supplies the
11
+ definition; `Qualifier` only evaluates what it is given. Inject a
12
+ [`@orkestrel/reason`](https://github.com/orkestrel/reason) `ReasonInterface` where
13
+ qualification shares an engine with the rest of your reasoning, and call `destroy()`
14
+ when the qualifier's work is done. Environment-agnostic — no I/O, no browser or
15
+ server assumptions. Part of the `@orkestrel` line.
11
16
 
12
17
  ## Install
13
18
 
@@ -17,22 +22,26 @@ npm install @orkestrel/qualifier
17
22
 
18
23
  ## Requirements
19
24
 
20
- - Node.js >= 24
21
- - ESM (`import`) and CommonJS (`require`) via the `exports` field
25
+ - Node.js >= 22.12.0
26
+ - ESM (`import`) and CommonJS (`require`) through the `exports` field
22
27
 
23
28
  ## Usage
24
29
 
25
30
  ```ts
26
- import { createQualifier, qualificationDefinition, rulingDefinition } from '@orkestrel/qualifier'
27
- import { atom, logicalDefinition, rule } from '@orkestrel/reason'
28
-
29
- const gates = logicalDefinition('gates', 'Eligibility gates', [
30
- rule('licensed', [atom('licensed', 'equals', false)], atom('blocked', 'equals', true)),
31
+ import { createQualificationDefinition, createQualifier, createRuling } from '@orkestrel/qualifier'
32
+ import { createAtom, createLogicalDefinition, createRule } from '@orkestrel/reason'
33
+
34
+ const gates = createLogicalDefinition('gates', 'Eligibility gates', [
35
+ createRule(
36
+ 'licensed',
37
+ [createAtom('licensed', 'equals', false)],
38
+ createAtom('blocked', 'equals', true),
39
+ ),
31
40
  ])
32
41
 
33
- const definition = qualificationDefinition('standard', 'Standard eligibility', [gates], {
42
+ const definition = createQualificationDefinition('standard', 'Standard eligibility', [gates], {
34
43
  rulings: [
35
- rulingDefinition('license', 'gates', 'licensed', 'restriction', {
44
+ createRuling('license', 'gates', 'licensed', 'restriction', {
36
45
  message: 'A license is required',
37
46
  }),
38
47
  ],
@@ -55,7 +64,7 @@ overload. Every `qualify` call fires once through `qualifier.emitter` (`qualify`
55
64
 
56
65
  For the full surface — `Qualifier`, `QualificationResult`, finding types, validators,
57
66
  factories, errors, and options — see
58
- [`guides/src/qualifier.md`](guides/src/qualifier.md).
67
+ [`guides/qualifier.md`](guides/qualifier.md).
59
68
 
60
69
  ## Package
61
70