@orkestrel/scaffold 0.0.115 → 0.0.116
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/dist/bin/main.js +137 -15
- package/dist/bin/main.js.map +1 -1
- package/dist/host/agents/skills/orkestrel-publish/references/wave.md +1 -1
- package/dist/host/claude/agents/orkestrel.md +1 -1
- package/dist/host/claude/rules/names.md +3 -1
- package/dist/host/guides/abort.md +17 -17
- package/dist/host/guides/agent.md +445 -445
- package/dist/host/guides/brief.md +143 -143
- package/dist/host/guides/browser.md +731 -731
- package/dist/host/guides/budget.md +39 -39
- package/dist/host/guides/capture.md +298 -298
- package/dist/host/guides/console.md +109 -109
- package/dist/host/guides/contract.md +335 -335
- package/dist/host/guides/csv.md +30 -30
- package/dist/host/guides/database.md +163 -163
- package/dist/host/guides/emitter.md +17 -17
- package/dist/host/guides/form.md +99 -99
- package/dist/host/guides/guide.md +361 -183
- package/dist/host/guides/html.md +49 -49
- package/dist/host/guides/indexeddb.md +40 -40
- package/dist/host/guides/interpret.md +139 -139
- package/dist/host/guides/lsp.md +114 -114
- package/dist/host/guides/markdown.md +68 -68
- package/dist/host/guides/mcp.md +3745 -3745
- package/dist/host/guides/middleware.md +170 -170
- package/dist/host/guides/msg.md +95 -95
- package/dist/host/guides/ndjson.md +8 -8
- package/dist/host/guides/ollama.md +56 -56
- package/dist/host/guides/pool.md +21 -21
- package/dist/host/guides/probe.md +82 -82
- package/dist/host/guides/process.md +99 -99
- package/dist/host/guides/program.md +98 -96
- package/dist/host/guides/qualifier.md +70 -70
- package/dist/host/guides/queue.md +37 -37
- package/dist/host/guides/rater.md +38 -38
- package/dist/host/guides/reason.md +308 -308
- package/dist/host/guides/relation.md +50 -50
- package/dist/host/guides/router.md +58 -58
- package/dist/host/guides/scaffold.md +554 -419
- package/dist/host/guides/sea.md +128 -128
- package/dist/host/guides/server.md +100 -100
- package/dist/host/guides/sqlite.md +28 -28
- package/dist/host/guides/sse.md +20 -20
- package/dist/host/guides/study.md +444 -444
- package/dist/host/guides/table.md +82 -82
- package/dist/host/guides/template.md +41 -41
- package/dist/host/guides/terminal.md +121 -121
- package/dist/host/guides/test.md +273 -273
- package/dist/host/guides/timeout.md +18 -18
- package/dist/host/guides/tool.md +27 -27
- package/dist/host/guides/toolbox.md +166 -166
- package/dist/host/guides/websocket.md +54 -54
- package/dist/host/guides/worker.md +24 -24
- package/dist/host/guides/workflow.md +187 -187
- package/dist/host/guides/workspace.md +55 -55
- package/dist/host/manifest.json +55 -55
- package/dist/host/tests/setupPolicy.ts +5 -3
- package/dist/src/core/index.cjs +89 -3
- package/dist/src/core/index.cjs.map +1 -1
- package/dist/src/core/index.d.cts +229 -144
- package/dist/src/core/index.d.ts +229 -144
- package/dist/src/core/index.js +87 -4
- package/dist/src/core/index.js.map +1 -1
- package/dist/src/server/index.cjs +292 -66
- package/dist/src/server/index.cjs.map +1 -1
- package/dist/src/server/index.d.cts +188 -6
- package/dist/src/server/index.d.ts +188 -6
- package/dist/src/server/index.js +287 -69
- package/dist/src/server/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -48,175 +48,175 @@ reason.reasoner('quantitative')?.supports(definition) // the reasoner's own guar
|
|
|
48
48
|
|
|
49
49
|
### Entity factories
|
|
50
50
|
|
|
51
|
-
|
|
|
52
|
-
| ---------------------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
-
| `createReason` | function | Creates the reasoning orchestrator. |
|
|
54
|
-
| `createQuantitativeReasoner` | function | Creates the quantitative reasoner — factor-based numeric scoring. |
|
|
55
|
-
| `createLogicalReasoner` | function | Creates the logical reasoner — rule-based deduction with forward / backward chaining. |
|
|
56
|
-
| `createSymbolicReasoner` | function | Creates the symbolic reasoner — algebraic equation solving by variable isolation. |
|
|
57
|
-
| `createInferentialReasoner` | function | Creates the inferential reasoner — fact derivation with unification variables and proof trees. |
|
|
58
|
-
| `createEvaluator` | function | Creates a check evaluator. |
|
|
59
|
-
| `createTransformer` | function | Creates a math transformer. |
|
|
60
|
-
| `createAggregator` | function | Creates a number aggregator. |
|
|
61
|
-
| `createDefinitionBuilder` | function | Creates a `DefinitionBuilder` — a stateful workspace builder accumulating a `Definition` through the `groups`, `factors`, `rules`, `equations`, `variables`, `facts`, and `inferences` self-owning manager properties. |
|
|
62
|
-
| `createSubjectBuilder` | function | Creates a `SubjectBuilder` — a stateful workspace builder accumulating a `Subject`. |
|
|
63
|
-
| `createGroupManager` | function | Creates a `GroupManager` — a self-owning manager over a quantitative definition's `groups`. |
|
|
64
|
-
| `createFactorManager` | function | Creates a `FactorManager` — the divergent manager over a group's `factors`, threaded through a required `groupId` locator. |
|
|
65
|
-
| `createRuleManager` | function | Creates a `RuleManager` — a self-owning manager over a logical definition's `rules`. |
|
|
66
|
-
| `createEquationManager` | function | Creates an `EquationManager` — a self-owning manager over a symbolic definition's `equations`. |
|
|
67
|
-
| `createVariableManager` | function | Creates a `VariableManager` — a self-owning manager over a symbolic definition's `variables` (a name-keyed record; `add` / `remove` only). |
|
|
68
|
-
| `createFactManager` | function | Creates a `FactManager` — a self-owning manager over an inferential definition's `facts`. |
|
|
69
|
-
| `createInferenceManager` | function | Creates an `InferenceManager` — a self-owning manager over an inferential definition's `inferences`. |
|
|
51
|
+
| Name | Kind | Signature | Summary |
|
|
52
|
+
| ---------------------------- | -------- | ------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
53
|
+
| `createReason` | function | `(options?: ReasonOptions) => ReasonInterface` | Creates the reasoning orchestrator. |
|
|
54
|
+
| `createQuantitativeReasoner` | function | `(options?: QuantitativeReasonerOptions) => ReasonerInterface` | Creates the quantitative reasoner — factor-based numeric scoring. |
|
|
55
|
+
| `createLogicalReasoner` | function | `(options?: LogicalReasonerOptions) => ReasonerInterface` | Creates the logical reasoner — rule-based deduction with forward / backward chaining. |
|
|
56
|
+
| `createSymbolicReasoner` | function | `(options?: SymbolicReasonerOptions) => ReasonerInterface` | Creates the symbolic reasoner — algebraic equation solving by variable isolation. |
|
|
57
|
+
| `createInferentialReasoner` | function | `(options?: InferentialReasonerOptions) => ReasonerInterface` | Creates the inferential reasoner — fact derivation with unification variables and proof trees. |
|
|
58
|
+
| `createEvaluator` | function | `(options?: EvaluatorOptions) => EvaluatorInterface` | Creates a check evaluator. |
|
|
59
|
+
| `createTransformer` | function | `(options?: TransformerOptions) => TransformerInterface` | Creates a math transformer. |
|
|
60
|
+
| `createAggregator` | function | `(options?: AggregatorOptions) => AggregatorInterface` | Creates a number aggregator. |
|
|
61
|
+
| `createDefinitionBuilder` | function | `(seed: Definition, options?: DefinitionBuilderOptions) => DefinitionBuilderInterface` | Creates a `DefinitionBuilder` — a stateful workspace builder accumulating a `Definition` through the `groups`, `factors`, `rules`, `equations`, `variables`, `facts`, and `inferences` self-owning manager properties. |
|
|
62
|
+
| `createSubjectBuilder` | function | `(seed: Subject, options?: SubjectBuilderOptions) => SubjectBuilderInterface` | Creates a `SubjectBuilder` — a stateful workspace builder accumulating a `Subject`. |
|
|
63
|
+
| `createGroupManager` | function | `(options?: GroupManagerOptions) => GroupManagerInterface` | Creates a `GroupManager` — a self-owning manager over a quantitative definition's `groups`. |
|
|
64
|
+
| `createFactorManager` | function | `(groups: GroupManagerInterface, options?: FactorManagerOptions) => FactorManagerInterface` | Creates a `FactorManager` — the divergent manager over a group's `factors`, threaded through a required `groupId` locator. |
|
|
65
|
+
| `createRuleManager` | function | `(options?: RuleManagerOptions) => RuleManagerInterface` | Creates a `RuleManager` — a self-owning manager over a logical definition's `rules`. |
|
|
66
|
+
| `createEquationManager` | function | `(options?: EquationManagerOptions) => EquationManagerInterface` | Creates an `EquationManager` — a self-owning manager over a symbolic definition's `equations`. |
|
|
67
|
+
| `createVariableManager` | function | `(options?: VariableManagerOptions) => VariableManagerInterface` | Creates a `VariableManager` — a self-owning manager over a symbolic definition's `variables` (a name-keyed record; `add` / `remove` only). |
|
|
68
|
+
| `createFactManager` | function | `(options?: FactManagerOptions) => FactManagerInterface` | Creates a `FactManager` — a self-owning manager over an inferential definition's `facts`. |
|
|
69
|
+
| `createInferenceManager` | function | `(options?: InferenceManagerOptions) => InferenceManagerInterface` | Creates an `InferenceManager` — a self-owning manager over an inferential definition's `inferences`. |
|
|
70
70
|
|
|
71
71
|
### Orchestrator & reasoners
|
|
72
72
|
|
|
73
|
-
|
|
|
74
|
-
| ---------------------- | ----- | ------------------------------------------------------------------------------------------- |
|
|
75
|
-
| `Reason` | class | Implements the reasoning orchestrator — a thin router over registered `ReasonerInterface`s. |
|
|
76
|
-
| `QuantitativeReasoner` | class | Performs factor-based numeric scoring. |
|
|
77
|
-
| `LogicalReasoner` | class | Deduces booleans from rules with forward or backward chaining. |
|
|
78
|
-
| `SymbolicReasoner` | class | Solves algebraic equations by variable isolation. |
|
|
79
|
-
| `InferentialReasoner` | class | Derives facts with unification variables and proof trees. |
|
|
73
|
+
| Name | Kind | Signature | Summary |
|
|
74
|
+
| ---------------------- | ----- | ------------------------------------------------------------------ | ------------------------------------------------------------------------------------------- |
|
|
75
|
+
| `Reason` | class | `new (options?: ReasonOptions) => ReasonInterface` | Implements the reasoning orchestrator — a thin router over registered `ReasonerInterface`s. |
|
|
76
|
+
| `QuantitativeReasoner` | class | `new (options?: QuantitativeReasonerOptions) => ReasonerInterface` | Performs factor-based numeric scoring. |
|
|
77
|
+
| `LogicalReasoner` | class | `new (options?: LogicalReasonerOptions) => ReasonerInterface` | Deduces booleans from rules with forward or backward chaining. |
|
|
78
|
+
| `SymbolicReasoner` | class | `new (options?: SymbolicReasonerOptions) => ReasonerInterface` | Solves algebraic equations by variable isolation. |
|
|
79
|
+
| `InferentialReasoner` | class | `new (options?: InferentialReasonerOptions) => ReasonerInterface` | Derives facts with unification variables and proof trees. |
|
|
80
80
|
|
|
81
81
|
### Operators
|
|
82
82
|
|
|
83
|
-
|
|
|
84
|
-
| ------------- | ----- | ----------------------------------------------------------------------------------------------------------------- |
|
|
85
|
-
| `Evaluator` | class | Evaluates `Check`s against subjects — the shared predicate engine of the quantitative and logical reasoners. |
|
|
86
|
-
| `Transformer` | class | Applies math `Transform`s to numbers — the quantitative reasoner's per-factor pipeline stage. |
|
|
87
|
-
| `Aggregator` | class | Reduces number lists to one number per `Aggregation` — the quantitative reasoner's group and definition combiner. |
|
|
83
|
+
| Name | Kind | Signature | Summary |
|
|
84
|
+
| ------------- | ----- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- |
|
|
85
|
+
| `Evaluator` | class | `new (options?: EvaluatorOptions) => EvaluatorInterface` | Evaluates `Check`s against subjects — the shared predicate engine of the quantitative and logical reasoners. |
|
|
86
|
+
| `Transformer` | class | `new (options?: TransformerOptions) => TransformerInterface` | Applies math `Transform`s to numbers — the quantitative reasoner's per-factor pipeline stage. |
|
|
87
|
+
| `Aggregator` | class | `new (options?: AggregatorOptions) => AggregatorInterface` | Reduces number lists to one number per `Aggregation` — the quantitative reasoner's group and definition combiner. |
|
|
88
88
|
|
|
89
89
|
### Classes
|
|
90
90
|
|
|
91
91
|
The definitions & subjects capability layer's stateful workspace builders: mutate through named methods, then `build()` a fresh plain payload to hand to `reason` at the call site. The managers are self-owning (each owns its own collection state and emitter, takes its own options, and has its own factory) and kind-free (an off-kind manager accumulates silently and is ignored by `build()` — never a `MISMATCH`). `DefinitionBuilder` and `SubjectBuilder` each carry a `unique symbol` brand — `DEFINITION_BUILDER_BRAND` and `SUBJECT_BUILDER_BRAND` — that `isDefinitionBuilder` and `isSubjectBuilder` read through `Reflect.get`, so plain data can never forge a builder.
|
|
92
92
|
|
|
93
|
-
|
|
|
94
|
-
| ------------------- | ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
-
| `DefinitionBuilder` | class | Implements a stateful workspace builder accumulating a `Definition` through always-present self-owning manager properties: a private scalar envelope (reasoning / id / name plus the kind's scalars) composed with each collection read from its manager. |
|
|
96
|
-
| `GroupManager` | class | Implements the `GroupManagerInterface` — a self-owning, kind-free manager over a quantitative definition's `groups`. |
|
|
97
|
-
| `FactorManager` | class | Implements the `FactorManagerInterface` — the one divergent manager: factors nest inside groups, so it holds no collection state of its own and threads a required `groupId` locator. |
|
|
98
|
-
| `RuleManager` | class | Implements the `RuleManagerInterface` — a self-owning, kind-free manager over a logical definition's `rules`. |
|
|
99
|
-
| `EquationManager` | class | Implements the `EquationManagerInterface` — a self-owning, kind-free manager over a symbolic definition's `equations`. |
|
|
100
|
-
| `VariableManager` | class | Implements the `VariableManagerInterface` — a self-owning, kind-free manager over a symbolic definition's `variables`, a name-keyed unordered record. |
|
|
101
|
-
| `FactManager` | class | Implements the `FactManagerInterface` — a self-owning, kind-free manager over an inferential definition's `facts`. |
|
|
102
|
-
| `InferenceManager` | class | Implements the `InferenceManagerInterface` — a self-owning, kind-free manager over an inferential definition's `inferences`. |
|
|
103
|
-
| `SubjectBuilder` | class | Implements a stateful workspace builder accumulating a `Subject` — one flat key-value collection, no managers. |
|
|
93
|
+
| Name | Kind | Signature | Summary |
|
|
94
|
+
| ------------------- | ----- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `DefinitionBuilder` | class | `new (seed: Definition, options?: DefinitionBuilderOptions) => DefinitionBuilderInterface` | Implements a stateful workspace builder accumulating a `Definition` through always-present self-owning manager properties: a private scalar envelope (reasoning / id / name plus the kind's scalars) composed with each collection read from its manager. |
|
|
96
|
+
| `GroupManager` | class | `new (options?: GroupManagerOptions) => GroupManagerInterface` | Implements the `GroupManagerInterface` — a self-owning, kind-free manager over a quantitative definition's `groups`. |
|
|
97
|
+
| `FactorManager` | class | `new (groups: GroupManagerInterface, options?: FactorManagerOptions) => FactorManagerInterface` | Implements the `FactorManagerInterface` — the one divergent manager: factors nest inside groups, so it holds no collection state of its own and threads a required `groupId` locator. |
|
|
98
|
+
| `RuleManager` | class | `new (options?: RuleManagerOptions) => RuleManagerInterface` | Implements the `RuleManagerInterface` — a self-owning, kind-free manager over a logical definition's `rules`. |
|
|
99
|
+
| `EquationManager` | class | `new (options?: EquationManagerOptions) => EquationManagerInterface` | Implements the `EquationManagerInterface` — a self-owning, kind-free manager over a symbolic definition's `equations`. |
|
|
100
|
+
| `VariableManager` | class | `new (options?: VariableManagerOptions) => VariableManagerInterface` | Implements the `VariableManagerInterface` — a self-owning, kind-free manager over a symbolic definition's `variables`, a name-keyed unordered record. |
|
|
101
|
+
| `FactManager` | class | `new (options?: FactManagerOptions) => FactManagerInterface` | Implements the `FactManagerInterface` — a self-owning, kind-free manager over an inferential definition's `facts`. |
|
|
102
|
+
| `InferenceManager` | class | `new (options?: InferenceManagerOptions) => InferenceManagerInterface` | Implements the `InferenceManagerInterface` — a self-owning, kind-free manager over an inferential definition's `inferences`. |
|
|
103
|
+
| `SubjectBuilder` | class | `new (seed: Subject, options?: SubjectBuilderOptions) => SubjectBuilderInterface` | Implements a stateful workspace builder accumulating a `Subject` — one flat key-value collection, no managers. |
|
|
104
104
|
|
|
105
105
|
### Value factories
|
|
106
106
|
|
|
107
107
|
Plain-data constructors for the declarative definition vocabulary — no lifecycle, no emitter, no identity. Reach for the entity factories earlier when you need a working instance instead.
|
|
108
108
|
|
|
109
|
-
|
|
|
110
|
-
| ------------------------------ | -------- | ---------------------------------------------------------------------------------------------------- |
|
|
111
|
-
| `createCheck` | function | Creates a `Check` — one field predicate. |
|
|
112
|
-
| `createAtom` | function | Creates an atom `Expression` — a leaf wrapping one `Check`. |
|
|
113
|
-
| `createCompound` | function | Creates a compound `Expression` — a logical connective over nested operands. |
|
|
114
|
-
| `createRule` | function | Creates a `Rule` — premises and a conclusion. |
|
|
115
|
-
| `createTransform` | function | Creates a `Transform` — one math step. |
|
|
116
|
-
| `createBounds` | function | Creates a `Bounds` — an inclusive numeric clamp. |
|
|
117
|
-
| `createVariable` | function | Creates a variable `SymbolicExpression` leaf. |
|
|
118
|
-
| `createConstant` | function | Creates a constant `SymbolicExpression` leaf. |
|
|
119
|
-
| `createOperation` | function | Creates an operation `SymbolicExpression` node. |
|
|
120
|
-
| `createEquation` | function | Creates an `Equation` — `left = right`, solved for `target`. |
|
|
121
|
-
| `createFact` | function | Creates a `Fact` — a predicate over positional terms. |
|
|
122
|
-
| `createInference` | function | Creates an `Inference` — premise patterns and a conclusion pattern. |
|
|
123
|
-
| `createStaticSource` | function | Creates a static `Source` — a fixed number. |
|
|
124
|
-
| `createFieldSource` | function | Creates a field `Source` — a subject field read as a number. |
|
|
125
|
-
| `createLookupSource` | function | Creates a lookup `Source` — a subject field mapped through a table. |
|
|
126
|
-
| `createRangeSource` | function | Creates a range `Source` — a numeric subject field banded through ordered ranges (first match wins). |
|
|
127
|
-
| `createStaticFactor` | function | Creates a `Factor` over a static `Source`. |
|
|
128
|
-
| `createFieldFactor` | function | Creates a `Factor` over a field `Source`. |
|
|
129
|
-
| `createLookupFactor` | function | Creates a `Factor` over a lookup `Source`. |
|
|
130
|
-
| `createRangeFactor` | function | Creates a `Factor` over a range `Source`. |
|
|
131
|
-
| `createFactorGroup` | function | Creates a `FactorGroup`. |
|
|
132
|
-
| `createQuantitativeDefinition` | function | Creates a `QuantitativeDefinition`. |
|
|
133
|
-
| `createLogicalDefinition` | function | Creates a `LogicalDefinition`. |
|
|
134
|
-
| `createSymbolicDefinition` | function | Creates a `SymbolicDefinition`. |
|
|
135
|
-
| `createInferentialDefinition` | function | Creates an `InferentialDefinition`. |
|
|
109
|
+
| Name | Kind | Signature | Summary |
|
|
110
|
+
| ------------------------------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
111
|
+
| `createCheck` | function | `(field: FieldPath, operator: Comparison, value: unknown) => Check` | Creates a `Check` — one field predicate. |
|
|
112
|
+
| `createAtom` | function | `(field: FieldPath, operator: Comparison, value: unknown) => Expression` | Creates an atom `Expression` — a leaf wrapping one `Check`. |
|
|
113
|
+
| `createCompound` | function | `(operator: LogicalOperator, operands: readonly Expression[]) => Expression` | Creates a compound `Expression` — a logical connective over nested operands. |
|
|
114
|
+
| `createRule` | function | `(id: string, premises: readonly Expression[], conclusion: Expression, overrides?: Partial<Omit<Rule, 'id' \| 'premises' \| 'conclusion'>>) => Rule` | Creates a `Rule` — premises and a conclusion. |
|
|
115
|
+
| `createTransform` | function | `(operator: MathOperation, operand?: number) => Transform` | Creates a `Transform` — one math step. |
|
|
116
|
+
| `createBounds` | function | `(minimum?: number, maximum?: number) => Bounds` | Creates a `Bounds` — an inclusive numeric clamp. |
|
|
117
|
+
| `createVariable` | function | `(name: string) => SymbolicExpression` | Creates a variable `SymbolicExpression` leaf. |
|
|
118
|
+
| `createConstant` | function | `(value: number) => SymbolicExpression` | Creates a constant `SymbolicExpression` leaf. |
|
|
119
|
+
| `createOperation` | function | `(operator: MathOperation, left: SymbolicExpression, right?: SymbolicExpression) => SymbolicExpression` | Creates an operation `SymbolicExpression` node. |
|
|
120
|
+
| `createEquation` | function | `(id: string, left: SymbolicExpression, right: SymbolicExpression, target: string, overrides?: Partial<Omit<Equation, 'id' \| 'left' \| 'right' \| 'target'>>) => Equation` | Creates an `Equation` — `left = right`, solved for `target`. |
|
|
121
|
+
| `createFact` | function | `(id: string, predicate: string, terms: readonly unknown[], confidence?: number) => Fact` | Creates a `Fact` — a predicate over positional terms. |
|
|
122
|
+
| `createInference` | function | `(id: string, premises: readonly Fact[], conclusion: Fact, overrides?: Partial<Omit<Inference, 'id' \| 'premises' \| 'conclusion'>>) => Inference` | Creates an `Inference` — premise patterns and a conclusion pattern. |
|
|
123
|
+
| `createStaticSource` | function | `(value: number) => Source` | Creates a static `Source` — a fixed number. |
|
|
124
|
+
| `createFieldSource` | function | `(field: FieldPath) => Source` | Creates a field `Source` — a subject field read as a number. |
|
|
125
|
+
| `createLookupSource` | function | `(field: FieldPath, table: Readonly<Record<string, number>>) => Source` | Creates a lookup `Source` — a subject field mapped through a table. |
|
|
126
|
+
| `createRangeSource` | function | `(field: FieldPath, ranges: readonly FactorRange[]) => Source` | Creates a range `Source` — a numeric subject field banded through ordered ranges (first match wins). |
|
|
127
|
+
| `createStaticFactor` | function | `(id: string, value: number, overrides?: Partial<Omit<Factor, 'id' \| 'source'>>) => Factor` | Creates a `Factor` over a static `Source`. |
|
|
128
|
+
| `createFieldFactor` | function | `(id: string, field: FieldPath, overrides?: Partial<Omit<Factor, 'id' \| 'source'>>) => Factor` | Creates a `Factor` over a field `Source`. |
|
|
129
|
+
| `createLookupFactor` | function | `(id: string, field: FieldPath, table: Readonly<Record<string, number>>, overrides?: Partial<Omit<Factor, 'id' \| 'source'>>) => Factor` | Creates a `Factor` over a lookup `Source`. |
|
|
130
|
+
| `createRangeFactor` | function | `(id: string, field: FieldPath, ranges: readonly FactorRange[], overrides?: Partial<Omit<Factor, 'id' \| 'source'>>) => Factor` | Creates a `Factor` over a range `Source`. |
|
|
131
|
+
| `createFactorGroup` | function | `(id: string, aggregation: Aggregation, factors: readonly Factor[], overrides?: Partial<Omit<FactorGroup, 'id' \| 'aggregation' \| 'factors'>>) => FactorGroup` | Creates a `FactorGroup`. |
|
|
132
|
+
| `createQuantitativeDefinition` | function | `(id: string, name: string, groups: readonly FactorGroup[], overrides?: Partial<Omit<QuantitativeDefinition, 'reasoning' \| 'id' \| 'name' \| 'groups'>>) => QuantitativeDefinition` | Creates a `QuantitativeDefinition`. |
|
|
133
|
+
| `createLogicalDefinition` | function | `(id: string, name: string, rules: readonly Rule[], overrides?: Partial<Omit<LogicalDefinition, 'reasoning' \| 'id' \| 'name' \| 'rules'>>) => LogicalDefinition` | Creates a `LogicalDefinition`. |
|
|
134
|
+
| `createSymbolicDefinition` | function | `(id: string, name: string, equations: readonly Equation[], overrides?: Partial<Omit<SymbolicDefinition, 'reasoning' \| 'id' \| 'name' \| 'equations'>>) => SymbolicDefinition` | Creates a `SymbolicDefinition`. |
|
|
135
|
+
| `createInferentialDefinition` | function | `(id: string, name: string, facts: readonly Fact[], inferences: readonly Inference[], overrides?: Partial<Omit<InferentialDefinition, 'reasoning' \| 'id' \| 'name' \| 'facts' \| 'inferences'>>) => InferentialDefinition` | Creates an `InferentialDefinition`. |
|
|
136
136
|
|
|
137
137
|
Every value factory returns a fresh object and omits absent optional keys entirely, so its output round-trips the exact-record validators in § Validators.
|
|
138
138
|
|
|
139
139
|
### Helpers
|
|
140
140
|
|
|
141
|
-
|
|
|
142
|
-
| -------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
143
|
-
| `formatField` | function | Formats a `FieldPath` for display — the single string key itself, or the array segments joined with `.`. |
|
|
144
|
-
| `clamp` | function | Clamps a number to inclusive `Bounds`. |
|
|
145
|
-
| `roundTo` | function | Rounds a number to a fixed count of decimal places. |
|
|
146
|
-
| `matchesBounds` | function | Checks whether a value falls inside an inclusive range expressed as an array. |
|
|
147
|
-
| `emptyAggregate` | function | Returns the empty-input identity of one `Aggregation`. |
|
|
148
|
-
| `resolveSource` | function | Resolves one `Source` against a subject, falling back when it cannot. |
|
|
149
|
-
| `equalValues` | function | Determines whether two values are SameValueZero-equal — strict `===` with `NaN` equal to itself (and, unlike `Object.is`, `+0` equal to `-0`). |
|
|
150
|
-
| `sortByPriority` | function | Sorts items ascending by `priority ?? DEFAULT_PRIORITY` — a stable copy sort. |
|
|
151
|
-
| `findDuplicates` | function | Collects the ids that appear more than once in an id-carrying list — each duplicated id reported once, in first-occurrence order. |
|
|
152
|
-
| `factToArityKey` | function | Derives a fact's predicate+arity bucket key — length-prefixed so the delimiter cannot be forged. |
|
|
153
|
-
| `indexByArity` | function | Buckets facts by predicate+arity, preserving append order within each bucket. |
|
|
154
|
-
| `termToKey` | function | Derives one fact term's contribution to a dedup key — reference identity for non-null objects / functions, a SameValueZero value string for primitives. |
|
|
155
|
-
| `factToKey` | function | Derives a fact's canonical dedup key — predicate + arity + per-term SameValueZero identity, with confidence excluded from it. |
|
|
156
|
-
| `matchFacts` | function | Unifies a pattern fact positionally against a candidate fact — returning the variable bindings on success, `undefined` on mismatch. |
|
|
157
|
-
| `instantiateFact` | function | Substitutes a fact's bound `'?'`-variables with their values — a fresh fact with unbound terms passed through unchanged. |
|
|
158
|
-
| `subjectToFacts` | function | Projects a subject's scalar fields into `has(key, value)` base facts — the inferential reasoner's subject-injection step. |
|
|
159
|
-
| `computePremiseConfidence` | function | Computes the confidence a set of matched premises contributes to a derived fact — the product of each premise's first matching fact's confidence. |
|
|
160
|
-
| `containsVariable` | function | Determines whether a symbolic expression contains an unbound occurrence of a target variable. |
|
|
161
|
-
| `invertLeft` | function | Inverts a `x op right = value` step, solving for the left operand `x`. |
|
|
162
|
-
| `invertRight` | function | Inverts a `left op x = value` step, solving for the right operand `x`. |
|
|
163
|
-
| `applyOperation` | function | Applies one binary/unary math operation to already-evaluated operands. |
|
|
164
|
-
| `resolveOperand` | function | Resolves the effective right operand of a math operation — the supplied `operand`, or the operation's own identity-preserving default when absent. |
|
|
165
|
-
| `extractAtoms` | function | Returns every atom leaf of an expression tree, depth-first, left-to-right. |
|
|
166
|
-
| `extractConclusions` | function | Flattens a logical conclusion expression into its asserted `field = value` pairs, ignoring the connectives. |
|
|
167
|
-
| `findOverlayMismatches` | function | Collects the flattened overlay keys written through an array path and also read through an array path. |
|
|
168
|
-
| `findUnboundVariables` | function | Collects the `'?'`-prefixed conclusion variables no premise binds. |
|
|
169
|
-
| `buildErrorResult` | function | Builds the empty, type-shaped failure `ReasonResult` matching a definition's reasoning. |
|
|
141
|
+
| Name | Kind | Signature | Summary |
|
|
142
|
+
| -------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
143
|
+
| `formatField` | function | `(field: FieldPath) => string` | Formats a `FieldPath` for display — the single string key itself, or the array segments joined with `.`. |
|
|
144
|
+
| `clamp` | function | `(value: number, limit?: Bounds) => number` | Clamps a number to inclusive `Bounds`. |
|
|
145
|
+
| `roundTo` | function | `(value: number, precision?: number) => number` | Rounds a number to a fixed count of decimal places. |
|
|
146
|
+
| `matchesBounds` | function | `(value: unknown, range: unknown) => boolean` | Checks whether a value falls inside an inclusive range expressed as an array. |
|
|
147
|
+
| `emptyAggregate` | function | `(aggregation: Aggregation) => number` | Returns the empty-input identity of one `Aggregation`. |
|
|
148
|
+
| `resolveSource` | function | `(source: Source, subject: Subject, fallback?: number) => number \| undefined` | Resolves one `Source` against a subject, falling back when it cannot. |
|
|
149
|
+
| `equalValues` | function | `(left: unknown, right: unknown) => boolean` | Determines whether two values are SameValueZero-equal — strict `===` with `NaN` equal to itself (and, unlike `Object.is`, `+0` equal to `-0`). |
|
|
150
|
+
| `sortByPriority` | function | `<T extends { readonly priority?: number; }>(items: readonly T[]) => readonly T[]` | Sorts items ascending by `priority ?? DEFAULT_PRIORITY` — a stable copy sort. |
|
|
151
|
+
| `findDuplicates` | function | `(items: ReadonlyArray<{ readonly id: string; }>) => readonly string[]` | Collects the ids that appear more than once in an id-carrying list — each duplicated id reported once, in first-occurrence order. |
|
|
152
|
+
| `factToArityKey` | function | `(fact: Fact) => string` | Derives a fact's predicate+arity bucket key — length-prefixed so the delimiter cannot be forged. |
|
|
153
|
+
| `indexByArity` | function | `(facts: readonly Fact[]) => ReadonlyMap<string, readonly Fact[]>` | Buckets facts by predicate+arity, preserving append order within each bucket. |
|
|
154
|
+
| `termToKey` | function | `(term: unknown, identities: Map<object, number>) => string` | Derives one fact term's contribution to a dedup key — reference identity for non-null objects / functions, a SameValueZero value string for primitives. |
|
|
155
|
+
| `factToKey` | function | `(fact: Fact, identities: Map<object, number>) => string` | Derives a fact's canonical dedup key — predicate + arity + per-term SameValueZero identity, with confidence excluded from it. |
|
|
156
|
+
| `matchFacts` | function | `(pattern: Fact, candidate: Fact) => Record<string, unknown> \| undefined` | Unifies a pattern fact positionally against a candidate fact — returning the variable bindings on success, `undefined` on mismatch. |
|
|
157
|
+
| `instantiateFact` | function | `(fact: Fact, bindings: Record<string, unknown>) => Fact` | Substitutes a fact's bound `'?'`-variables with their values — a fresh fact with unbound terms passed through unchanged. |
|
|
158
|
+
| `subjectToFacts` | function | `(subject: Subject) => { readonly facts: readonly Fact[]; readonly trace: readonly string[]; }` | Projects a subject's scalar fields into `has(key, value)` base facts — the inferential reasoner's subject-injection step. |
|
|
159
|
+
| `computePremiseConfidence` | function | `(premises: readonly Fact[], index: ReadonlyMap<string, readonly Fact[]>, bindings: Record<string, unknown>) => number` | Computes the confidence a set of matched premises contributes to a derived fact — the product of each premise's first matching fact's confidence. |
|
|
160
|
+
| `containsVariable` | function | `(expression: SymbolicExpression, target: string, bindings: Record<string, number>) => boolean` | Determines whether a symbolic expression contains an unbound occurrence of a target variable. |
|
|
161
|
+
| `invertLeft` | function | `(operator: MathOperation, value: number, rightValue: number) => number` | Inverts a `x op right = value` step, solving for the left operand `x`. |
|
|
162
|
+
| `invertRight` | function | `(operator: MathOperation, value: number, leftValue: number) => number` | Inverts a `left op x = value` step, solving for the right operand `x`. |
|
|
163
|
+
| `applyOperation` | function | `(operator: string, left: number, right: number) => number` | Applies one binary/unary math operation to already-evaluated operands. |
|
|
164
|
+
| `resolveOperand` | function | `(operation: MathOperation, operand?: number) => number` | Resolves the effective right operand of a math operation — the supplied `operand`, or the operation's own identity-preserving default when absent. |
|
|
165
|
+
| `extractAtoms` | function | `(expression: Expression) => readonly Atom[]` | Returns every atom leaf of an expression tree, depth-first, left-to-right. |
|
|
166
|
+
| `extractConclusions` | function | `(expression: Expression) => Record<string, unknown>` | Flattens a logical conclusion expression into its asserted `field = value` pairs, ignoring the connectives. |
|
|
167
|
+
| `findOverlayMismatches` | function | `(rules: readonly Rule[]) => readonly string[]` | Collects the flattened overlay keys written through an array path and also read through an array path. |
|
|
168
|
+
| `findUnboundVariables` | function | `(inference: Inference) => readonly string[]` | Collects the `'?'`-prefixed conclusion variables no premise binds. |
|
|
169
|
+
| `buildErrorResult` | function | `(definition: Definition, message: string) => ReasonResult` | Builds the empty, type-shaped failure `ReasonResult` matching a definition's reasoning. |
|
|
170
170
|
|
|
171
171
|
The definitions & subjects capability layer (§ Classes) adds a pure, copy-on-write change / extend / merge / store surface over every definition kind, plus a subject engine of pure helpers — none of it mutates an input, and every helper returns a fresh value.
|
|
172
172
|
|
|
173
|
-
|
|
|
174
|
-
| ----------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
175
|
-
| `appendById` | function | Inserts `item` into an id-keyed collection, deduping any existing element sharing its id, then placing it at the end, or immediately after `target`. |
|
|
176
|
-
| `prependById` | function | Inserts `item` into an id-keyed collection, deduping any existing element sharing its id, then placing it at the start, or immediately before `target`. |
|
|
177
|
-
| `replaceById` | function | Swaps the element sharing `item.id` in place, preserving its position. |
|
|
178
|
-
| `removeById` | function | Filters every element sharing `id` out of an id-keyed collection. |
|
|
179
|
-
| `mergeById` | function | Reconciles two id-keyed collections — an incoming-order upsert with base-only survivors appended after. |
|
|
180
|
-
| `definitionToEnvelope` | function | Projects a `Definition` to its scalar envelope — the kind's collections drop out. |
|
|
181
|
-
| `appendGroup` | function | Inserts `group` into a `QuantitativeDefinition`'s `groups` — dedup-then- insert at the end, or immediately after `target`. |
|
|
182
|
-
| `prependGroup` | function | Inserts `group` into a `QuantitativeDefinition`'s `groups` — dedup-then- insert at the start, or immediately before `target`. |
|
|
183
|
-
| `replaceGroup` | function | Swaps the group sharing `group.id` in a `QuantitativeDefinition` in place, preserving its position (appended when absent). |
|
|
184
|
-
| `removeGroup` | function | Removes every group sharing `id` from a `QuantitativeDefinition` (no-op when absent). |
|
|
185
|
-
| `appendFactor` | function | Inserts `factor` into a `FactorGroup`'s `factors` — dedup-then-insert at the end, or immediately after `target`. |
|
|
186
|
-
| `prependFactor` | function | Inserts `factor` into a `FactorGroup`'s `factors` — dedup-then-insert at the start, or immediately before `target`. |
|
|
187
|
-
| `replaceFactor` | function | Swaps the factor sharing `factor.id` in a `FactorGroup` in place, preserving its position (appended when absent). |
|
|
188
|
-
| `removeFactor` | function | Removes every factor sharing `id` from a `FactorGroup` (no-op when absent). |
|
|
189
|
-
| `appendRule` | function | Inserts a rule into a `LogicalDefinition`'s `rules` — dedup-then-insert at the end, or immediately after `target`. |
|
|
190
|
-
| `prependRule` | function | Inserts a rule into a `LogicalDefinition`'s `rules` — dedup-then-insert at the start, or immediately before `target`. |
|
|
191
|
-
| `replaceRule` | function | Swaps the rule sharing `rule.id` in a `LogicalDefinition` in place, preserving its position (appended when absent). |
|
|
192
|
-
| `removeRule` | function | Removes every rule sharing `id` from a `LogicalDefinition` (no-op when absent). |
|
|
193
|
-
| `appendEquation` | function | Inserts an equation into a `SymbolicDefinition`'s `equations` — dedup- then-insert at the end, or immediately after `target`. |
|
|
194
|
-
| `prependEquation` | function | Inserts an equation into a `SymbolicDefinition`'s `equations` — dedup- then-insert at the start, or immediately before `target`. |
|
|
195
|
-
| `replaceEquation` | function | Swaps the equation sharing `equation.id` in a `SymbolicDefinition` in place, preserving its position (appended when absent). |
|
|
196
|
-
| `removeEquation` | function | Removes every equation sharing `id` from a `SymbolicDefinition` (no-op when absent). |
|
|
197
|
-
| `addVariable` | function | Upserts one entry of a `SymbolicDefinition`'s `variables`. |
|
|
198
|
-
| `removeVariable` | function | Removes one entry of a `SymbolicDefinition`'s `variables`. |
|
|
199
|
-
| `appendFact` | function | Inserts a fact into an `InferentialDefinition`'s `facts` — dedup-then- insert at the end, or immediately after `target`. |
|
|
200
|
-
| `prependFact` | function | Inserts a fact into an `InferentialDefinition`'s `facts` — dedup-then- insert at the start, or immediately before `target`. |
|
|
201
|
-
| `replaceFact` | function | Swaps the fact sharing `fact.id` in an `InferentialDefinition` in place, preserving its position (appended when absent). |
|
|
202
|
-
| `removeFact` | function | Removes every fact sharing `id` from an `InferentialDefinition` (no-op when absent). |
|
|
203
|
-
| `appendInference` | function | Inserts an inference into an `InferentialDefinition`'s `inferences` — dedup-then-insert at the end, or immediately after `target`. |
|
|
204
|
-
| `prependInference` | function | Inserts an inference into an `InferentialDefinition`'s `inferences` — dedup-then-insert at the start, or immediately before `target`. |
|
|
205
|
-
| `replaceInference` | function | Swaps the inference sharing `inference.id` in an `InferentialDefinition` in place, preserving its position (appended when absent). |
|
|
206
|
-
| `removeInference` | function | Removes every inference sharing `id` from an `InferentialDefinition` (no-op when absent). |
|
|
207
|
-
| `mergeQuantitativeDefinition` | function | Reconciles two `QuantitativeDefinition`s onto `base`'s id. |
|
|
208
|
-
| `mergeLogicalDefinition` | function | Reconciles two `LogicalDefinition`s onto `base`'s id. |
|
|
209
|
-
| `mergeSymbolicDefinition` | function | Reconciles two `SymbolicDefinition`s onto `base`'s id. |
|
|
210
|
-
| `mergeInferentialDefinition` | function | Reconciles two `InferentialDefinition`s onto `base`'s id. |
|
|
211
|
-
| `clearQuantitativeDefinition` | function | Deletes one optional field of a `QuantitativeDefinition`. |
|
|
212
|
-
| `clearLogicalDefinition` | function | Deletes one optional field of a `LogicalDefinition`. |
|
|
213
|
-
| `clearSymbolicDefinition` | function | Deletes one optional field of a `SymbolicDefinition`. |
|
|
214
|
-
| `clearInferentialDefinition` | function | Deletes one optional field of an `InferentialDefinition`. |
|
|
215
|
-
| `parseDefinition` | function | Parses a JSON string into a `Definition`, failing safe to `undefined`. |
|
|
216
|
-
| `assignField` | function | Upserts one field of a `Subject` — copy-on-write spread. |
|
|
217
|
-
| `removeField` | function | Deletes one field of a `Subject` — destructure-rest omit. |
|
|
218
|
-
| `mergeSubjects` | function | Reconciles two `Subject`s — incoming-wins spread, with the base `id` preserved when present. |
|
|
219
|
-
| `repeatSubject` | function | Produces `count` deterministic clones of a `Subject`. |
|
|
173
|
+
| Name | Kind | Signature | Summary |
|
|
174
|
+
| ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
175
|
+
| `appendById` | function | `<T extends { readonly id: string; }>(items: readonly T[], item: T, target?: string) => readonly T[]` | Inserts `item` into an id-keyed collection, deduping any existing element sharing its id, then placing it at the end, or immediately after `target`. |
|
|
176
|
+
| `prependById` | function | `<T extends { readonly id: string; }>(items: readonly T[], item: T, target?: string) => readonly T[]` | Inserts `item` into an id-keyed collection, deduping any existing element sharing its id, then placing it at the start, or immediately before `target`. |
|
|
177
|
+
| `replaceById` | function | `<T extends { readonly id: string; }>(items: readonly T[], item: T) => readonly T[]` | Swaps the element sharing `item.id` in place, preserving its position. |
|
|
178
|
+
| `removeById` | function | `<T extends { readonly id: string; }>(items: readonly T[], id: string) => readonly T[]` | Filters every element sharing `id` out of an id-keyed collection. |
|
|
179
|
+
| `mergeById` | function | `<T extends { readonly id: string; }>(base: readonly T[], incoming: readonly T[], resolve?: (base: T, incoming: T) => T) => readonly T[]` | Reconciles two id-keyed collections — an incoming-order upsert with base-only survivors appended after. |
|
|
180
|
+
| `definitionToEnvelope` | function | `(definition: Definition) => DefinitionEnvelope` | Projects a `Definition` to its scalar envelope — the kind's collections drop out. |
|
|
181
|
+
| `appendGroup` | function | `(definition: QuantitativeDefinition, group: FactorGroup, target?: string) => QuantitativeDefinition` | Inserts `group` into a `QuantitativeDefinition`'s `groups` — dedup-then- insert at the end, or immediately after `target`. |
|
|
182
|
+
| `prependGroup` | function | `(definition: QuantitativeDefinition, group: FactorGroup, target?: string) => QuantitativeDefinition` | Inserts `group` into a `QuantitativeDefinition`'s `groups` — dedup-then- insert at the start, or immediately before `target`. |
|
|
183
|
+
| `replaceGroup` | function | `(definition: QuantitativeDefinition, group: FactorGroup) => QuantitativeDefinition` | Swaps the group sharing `group.id` in a `QuantitativeDefinition` in place, preserving its position (appended when absent). |
|
|
184
|
+
| `removeGroup` | function | `(definition: QuantitativeDefinition, id: string) => QuantitativeDefinition` | Removes every group sharing `id` from a `QuantitativeDefinition` (no-op when absent). |
|
|
185
|
+
| `appendFactor` | function | `(group: FactorGroup, factor: Factor, target?: string) => FactorGroup` | Inserts `factor` into a `FactorGroup`'s `factors` — dedup-then-insert at the end, or immediately after `target`. |
|
|
186
|
+
| `prependFactor` | function | `(group: FactorGroup, factor: Factor, target?: string) => FactorGroup` | Inserts `factor` into a `FactorGroup`'s `factors` — dedup-then-insert at the start, or immediately before `target`. |
|
|
187
|
+
| `replaceFactor` | function | `(group: FactorGroup, factor: Factor) => FactorGroup` | Swaps the factor sharing `factor.id` in a `FactorGroup` in place, preserving its position (appended when absent). |
|
|
188
|
+
| `removeFactor` | function | `(group: FactorGroup, id: string) => FactorGroup` | Removes every factor sharing `id` from a `FactorGroup` (no-op when absent). |
|
|
189
|
+
| `appendRule` | function | `(definition: LogicalDefinition, rule: Rule, target?: string) => LogicalDefinition` | Inserts a rule into a `LogicalDefinition`'s `rules` — dedup-then-insert at the end, or immediately after `target`. |
|
|
190
|
+
| `prependRule` | function | `(definition: LogicalDefinition, rule: Rule, target?: string) => LogicalDefinition` | Inserts a rule into a `LogicalDefinition`'s `rules` — dedup-then-insert at the start, or immediately before `target`. |
|
|
191
|
+
| `replaceRule` | function | `(definition: LogicalDefinition, rule: Rule) => LogicalDefinition` | Swaps the rule sharing `rule.id` in a `LogicalDefinition` in place, preserving its position (appended when absent). |
|
|
192
|
+
| `removeRule` | function | `(definition: LogicalDefinition, id: string) => LogicalDefinition` | Removes every rule sharing `id` from a `LogicalDefinition` (no-op when absent). |
|
|
193
|
+
| `appendEquation` | function | `(definition: SymbolicDefinition, equation: Equation, target?: string) => SymbolicDefinition` | Inserts an equation into a `SymbolicDefinition`'s `equations` — dedup- then-insert at the end, or immediately after `target`. |
|
|
194
|
+
| `prependEquation` | function | `(definition: SymbolicDefinition, equation: Equation, target?: string) => SymbolicDefinition` | Inserts an equation into a `SymbolicDefinition`'s `equations` — dedup- then-insert at the start, or immediately before `target`. |
|
|
195
|
+
| `replaceEquation` | function | `(definition: SymbolicDefinition, equation: Equation) => SymbolicDefinition` | Swaps the equation sharing `equation.id` in a `SymbolicDefinition` in place, preserving its position (appended when absent). |
|
|
196
|
+
| `removeEquation` | function | `(definition: SymbolicDefinition, id: string) => SymbolicDefinition` | Removes every equation sharing `id` from a `SymbolicDefinition` (no-op when absent). |
|
|
197
|
+
| `addVariable` | function | `(definition: SymbolicDefinition, name: string, value: number) => SymbolicDefinition` | Upserts one entry of a `SymbolicDefinition`'s `variables`. |
|
|
198
|
+
| `removeVariable` | function | `(definition: SymbolicDefinition, name: string) => SymbolicDefinition` | Removes one entry of a `SymbolicDefinition`'s `variables`. |
|
|
199
|
+
| `appendFact` | function | `(definition: InferentialDefinition, fact: Fact, target?: string) => InferentialDefinition` | Inserts a fact into an `InferentialDefinition`'s `facts` — dedup-then- insert at the end, or immediately after `target`. |
|
|
200
|
+
| `prependFact` | function | `(definition: InferentialDefinition, fact: Fact, target?: string) => InferentialDefinition` | Inserts a fact into an `InferentialDefinition`'s `facts` — dedup-then- insert at the start, or immediately before `target`. |
|
|
201
|
+
| `replaceFact` | function | `(definition: InferentialDefinition, fact: Fact) => InferentialDefinition` | Swaps the fact sharing `fact.id` in an `InferentialDefinition` in place, preserving its position (appended when absent). |
|
|
202
|
+
| `removeFact` | function | `(definition: InferentialDefinition, id: string) => InferentialDefinition` | Removes every fact sharing `id` from an `InferentialDefinition` (no-op when absent). |
|
|
203
|
+
| `appendInference` | function | `(definition: InferentialDefinition, inference: Inference, target?: string) => InferentialDefinition` | Inserts an inference into an `InferentialDefinition`'s `inferences` — dedup-then-insert at the end, or immediately after `target`. |
|
|
204
|
+
| `prependInference` | function | `(definition: InferentialDefinition, inference: Inference, target?: string) => InferentialDefinition` | Inserts an inference into an `InferentialDefinition`'s `inferences` — dedup-then-insert at the start, or immediately before `target`. |
|
|
205
|
+
| `replaceInference` | function | `(definition: InferentialDefinition, inference: Inference) => InferentialDefinition` | Swaps the inference sharing `inference.id` in an `InferentialDefinition` in place, preserving its position (appended when absent). |
|
|
206
|
+
| `removeInference` | function | `(definition: InferentialDefinition, id: string) => InferentialDefinition` | Removes every inference sharing `id` from an `InferentialDefinition` (no-op when absent). |
|
|
207
|
+
| `mergeQuantitativeDefinition` | function | `(base: QuantitativeDefinition, incoming: QuantitativeDefinition) => QuantitativeDefinition` | Reconciles two `QuantitativeDefinition`s onto `base`'s id. |
|
|
208
|
+
| `mergeLogicalDefinition` | function | `(base: LogicalDefinition, incoming: LogicalDefinition) => LogicalDefinition` | Reconciles two `LogicalDefinition`s onto `base`'s id. |
|
|
209
|
+
| `mergeSymbolicDefinition` | function | `(base: SymbolicDefinition, incoming: SymbolicDefinition) => SymbolicDefinition` | Reconciles two `SymbolicDefinition`s onto `base`'s id. |
|
|
210
|
+
| `mergeInferentialDefinition` | function | `(base: InferentialDefinition, incoming: InferentialDefinition) => InferentialDefinition` | Reconciles two `InferentialDefinition`s onto `base`'s id. |
|
|
211
|
+
| `clearQuantitativeDefinition` | function | `(definition: QuantitativeDefinition, key: QuantitativeClearKey) => QuantitativeDefinition` | Deletes one optional field of a `QuantitativeDefinition`. |
|
|
212
|
+
| `clearLogicalDefinition` | function | `(definition: LogicalDefinition, key: LogicalClearKey) => LogicalDefinition` | Deletes one optional field of a `LogicalDefinition`. |
|
|
213
|
+
| `clearSymbolicDefinition` | function | `(definition: SymbolicDefinition, key: SymbolicClearKey) => SymbolicDefinition` | Deletes one optional field of a `SymbolicDefinition`. |
|
|
214
|
+
| `clearInferentialDefinition` | function | `(definition: InferentialDefinition, key: InferentialClearKey) => InferentialDefinition` | Deletes one optional field of an `InferentialDefinition`. |
|
|
215
|
+
| `parseDefinition` | function | `(json: string) => Definition \| undefined` | Parses a JSON string into a `Definition`, failing safe to `undefined`. |
|
|
216
|
+
| `assignField` | function | `(subject: Subject, key: string, value: unknown) => Subject` | Upserts one field of a `Subject` — copy-on-write spread. |
|
|
217
|
+
| `removeField` | function | `(subject: Subject, key: string) => Subject` | Deletes one field of a `Subject` — destructure-rest omit. |
|
|
218
|
+
| `mergeSubjects` | function | `(base: Subject, incoming: Subject) => Subject` | Reconciles two `Subject`s — incoming-wins spread, with the base `id` preserved when present. |
|
|
219
|
+
| `repeatSubject` | function | `(subject: Subject, count: number) => readonly Subject[]` | Produces `count` deterministic clones of a `Subject`. |
|
|
220
220
|
|
|
221
221
|
### Validators
|
|
222
222
|
|
|
@@ -224,59 +224,59 @@ Total guards return `false`, never throw, for adversarial input such as junk, cy
|
|
|
224
224
|
|
|
225
225
|
In a guard table a `Shape` cell holds the type the guard narrows to.
|
|
226
226
|
|
|
227
|
-
|
|
|
228
|
-
| -------------------------- | -------- |
|
|
229
|
-
| `isReasoning` | const | `Reasoning
|
|
230
|
-
| `isChainStrategy` | const | `ChainStrategy
|
|
231
|
-
| `isMathOperation` | const | `MathOperation
|
|
232
|
-
| `isAggregation` | const | `Aggregation
|
|
233
|
-
| `isComparison` | const | `Comparison
|
|
234
|
-
| `isLogicalOperator` | const | `LogicalOperator
|
|
235
|
-
| `isFieldPath` | const | `FieldPath
|
|
236
|
-
| `isNumberRecord` | const | `Readonly<Record<string, number
|
|
237
|
-
| `isCheck` | function | `Check`
|
|
238
|
-
| `isTransform` | function | `Transform`
|
|
239
|
-
| `isBounds` | function | `Bounds`
|
|
240
|
-
| `isFactorRange` | function | `FactorRange`
|
|
241
|
-
| `isSource` | function | `Source`
|
|
242
|
-
| `isFactor` | function | `Factor`
|
|
243
|
-
| `isFactorGroup` | function | `FactorGroup`
|
|
244
|
-
| `isExpression` | function | `Expression`
|
|
245
|
-
| `isRule` | function | `Rule`
|
|
246
|
-
| `isSymbolicExpression` | function | `SymbolicExpression`
|
|
247
|
-
| `isEquation` | function | `Equation`
|
|
248
|
-
| `isFact` | function | `Fact`
|
|
249
|
-
| `isInference` | function | `Inference`
|
|
250
|
-
| `isQuantitativeDefinition` | function | `QuantitativeDefinition`
|
|
251
|
-
| `isLogicalDefinition` | function | `LogicalDefinition`
|
|
252
|
-
| `isSymbolicDefinition` | function | `SymbolicDefinition`
|
|
253
|
-
| `isInferentialDefinition` | function | `InferentialDefinition`
|
|
254
|
-
| `isDefinition` | function | `Definition`
|
|
255
|
-
| `isQuantitativeClearKey` | const | `QuantitativeClearKey
|
|
256
|
-
| `isLogicalClearKey` | const | `LogicalClearKey
|
|
257
|
-
| `isSymbolicClearKey` | const | `SymbolicClearKey
|
|
258
|
-
| `isInferentialClearKey` | const | `InferentialClearKey
|
|
259
|
-
| `isResultFact` | function | `Fact`
|
|
260
|
-
| `isCheckResult` | function | `CheckResult`
|
|
261
|
-
| `isFactorResult` | function | `FactorResult`
|
|
262
|
-
| `isGroupResult` | function | `GroupResult`
|
|
263
|
-
| `isRuleResult` | function | `RuleResult`
|
|
264
|
-
| `isProofNode` | function | `ProofNode`
|
|
265
|
-
| `isQuantitativeResult` | function | `QuantitativeResult`
|
|
266
|
-
| `isLogicalResult` | function | `LogicalResult`
|
|
267
|
-
| `isSymbolicResult` | function | `SymbolicResult`
|
|
268
|
-
| `isInferentialResult` | function | `InferentialResult`
|
|
269
|
-
| `isReasonResult` | function | `ReasonResult`
|
|
270
|
-
| `isReasonValidationResult` | function | `ReasonValidationResult`
|
|
271
|
-
| `isDefinitionBuilder` | function | `DefinitionBuilderInterface`
|
|
272
|
-
| `isSubjectBuilder` | function | `SubjectBuilderInterface`
|
|
227
|
+
| Name | Kind | Signature | Summary |
|
|
228
|
+
| -------------------------- | -------- | --------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
229
|
+
| `isReasoning` | const | `Guard<Reasoning>` | Determines whether a value is a `Reasoning` literal. |
|
|
230
|
+
| `isChainStrategy` | const | `Guard<ChainStrategy>` | Determines whether a value is a `ChainStrategy` literal. |
|
|
231
|
+
| `isMathOperation` | const | `Guard<MathOperation>` | Determines whether a value is a `MathOperation` literal. |
|
|
232
|
+
| `isAggregation` | const | `Guard<Aggregation>` | Determines whether a value is an `Aggregation` literal. |
|
|
233
|
+
| `isComparison` | const | `Guard<Comparison>` | Determines whether a value is a `Comparison` literal. |
|
|
234
|
+
| `isLogicalOperator` | const | `Guard<LogicalOperator>` | Determines whether a value is a `LogicalOperator` literal. |
|
|
235
|
+
| `isFieldPath` | const | `Guard<FieldPath>` | Determines whether a value is a `FieldPath` — a single string key or an array of keys descending into nested objects. |
|
|
236
|
+
| `isNumberRecord` | const | `Guard<Readonly<Record<string, number>>>` | Determines whether a value is a record whose every value is a finite number — the shape of a `LookupSource.table` and a `SymbolicDefinition.variables`. |
|
|
237
|
+
| `isCheck` | function | `(value: unknown) => value is Check` | Determines whether a value is a `Check` — a field / operator / value predicate. |
|
|
238
|
+
| `isTransform` | function | `(value: unknown) => value is Transform` | Determines whether a value is a `Transform` — one math step. |
|
|
239
|
+
| `isBounds` | function | `(value: unknown) => value is Bounds` | Determines whether a value is a `Bounds` — an inclusive numeric clamp. |
|
|
240
|
+
| `isFactorRange` | function | `(value: unknown) => value is FactorRange` | Determines whether a value is a `FactorRange` — one band of a range source. |
|
|
241
|
+
| `isSource` | function | `(value: unknown) => value is Source` | Determines whether a value is a `Source` — a static, field, lookup, or range factor source, discriminated by `origin`. |
|
|
242
|
+
| `isFactor` | function | `(value: unknown) => value is Factor` | Determines whether a value is a `Factor` — one scored input of a quantitative group. |
|
|
243
|
+
| `isFactorGroup` | function | `(value: unknown) => value is FactorGroup` | Determines whether a value is a `FactorGroup` — a group of factors aggregated into one value. |
|
|
244
|
+
| `isExpression` | function | `(value: unknown) => value is Expression` | Determines whether a value is an `Expression` — a boolean expression tree of atoms and compounds, discriminated by `form`. |
|
|
245
|
+
| `isRule` | function | `(value: unknown) => value is Rule` | Determines whether a value is a `Rule` — premises and a conclusion. |
|
|
246
|
+
| `isSymbolicExpression` | function | `(value: unknown) => value is SymbolicExpression` | Determines whether a value is a `SymbolicExpression` — an algebraic expression tree of variables, constants, and operations, discriminated by `form`. |
|
|
247
|
+
| `isEquation` | function | `(value: unknown) => value is Equation` | Determines whether a value is an `Equation` — `left = right`, solved for `target`. |
|
|
248
|
+
| `isFact` | function | `(value: unknown) => value is Fact` | Determines whether a value is a `Fact` — a predicate over positional terms. |
|
|
249
|
+
| `isInference` | function | `(value: unknown) => value is Inference` | Determines whether a value is an `Inference` — premise patterns and a conclusion pattern. |
|
|
250
|
+
| `isQuantitativeDefinition` | function | `(value: unknown) => value is QuantitativeDefinition` | Determines whether a value is a `QuantitativeDefinition`. |
|
|
251
|
+
| `isLogicalDefinition` | function | `(value: unknown) => value is LogicalDefinition` | Determines whether a value is a `LogicalDefinition`. |
|
|
252
|
+
| `isSymbolicDefinition` | function | `(value: unknown) => value is SymbolicDefinition` | Determines whether a value is a `SymbolicDefinition`. |
|
|
253
|
+
| `isInferentialDefinition` | function | `(value: unknown) => value is InferentialDefinition` | Determines whether a value is an `InferentialDefinition`. |
|
|
254
|
+
| `isDefinition` | function | `(value: unknown) => value is Definition` | Determines whether a value is a `Definition` — a quantitative, logical, symbolic, or inferential definition shape, discriminated by `reasoning`. |
|
|
255
|
+
| `isQuantitativeClearKey` | const | `Guard<QuantitativeClearKey>` | Determines whether a value is a `QuantitativeClearKey` — an optional field `clearQuantitativeDefinition` can delete. |
|
|
256
|
+
| `isLogicalClearKey` | const | `Guard<LogicalClearKey>` | Determines whether a value is a `LogicalClearKey` — an optional field `clearLogicalDefinition` can delete. |
|
|
257
|
+
| `isSymbolicClearKey` | const | `Guard<SymbolicClearKey>` | Determines whether a value is a `SymbolicClearKey` — an optional field `clearSymbolicDefinition` can delete. |
|
|
258
|
+
| `isInferentialClearKey` | const | `Guard<InferentialClearKey>` | Determines whether a value is an `InferentialClearKey` — an optional field `clearInferentialDefinition` can delete. |
|
|
259
|
+
| `isResultFact` | function | `(value: unknown) => value is Fact` | Determines whether a value is a result-side `Fact`. |
|
|
260
|
+
| `isCheckResult` | function | `(value: unknown) => value is CheckResult` | Determines whether a value is a `CheckResult`. |
|
|
261
|
+
| `isFactorResult` | function | `(value: unknown) => value is FactorResult` | Determines whether a value is a `FactorResult`. |
|
|
262
|
+
| `isGroupResult` | function | `(value: unknown) => value is GroupResult` | Determines whether a value is a `GroupResult`. |
|
|
263
|
+
| `isRuleResult` | function | `(value: unknown) => value is RuleResult` | Determines whether a value is a `RuleResult`. |
|
|
264
|
+
| `isProofNode` | function | `(value: unknown) => value is ProofNode` | Determines whether a value is a depth-bounded, acyclic `ProofNode` tree. |
|
|
265
|
+
| `isQuantitativeResult` | function | `(value: unknown) => value is QuantitativeResult` | Determines whether a value is a `QuantitativeResult`. |
|
|
266
|
+
| `isLogicalResult` | function | `(value: unknown) => value is LogicalResult` | Determines whether a value is a `LogicalResult`. |
|
|
267
|
+
| `isSymbolicResult` | function | `(value: unknown) => value is SymbolicResult` | Determines whether a value is a `SymbolicResult`. |
|
|
268
|
+
| `isInferentialResult` | function | `(value: unknown) => value is InferentialResult` | Determines whether a value is an `InferentialResult`. |
|
|
269
|
+
| `isReasonResult` | function | `(value: unknown) => value is ReasonResult` | Determines whether a value is any `ReasonResult` arm. |
|
|
270
|
+
| `isReasonValidationResult` | function | `(value: unknown) => value is ReasonValidationResult` | Determines whether a value is a `ReasonValidationResult`. |
|
|
271
|
+
| `isDefinitionBuilder` | function | `(value: unknown) => value is DefinitionBuilderInterface` | Determines whether a value is a `DefinitionBuilder` entity — the brand-guarded stateful workspace, not the plain `Definition` data union. |
|
|
272
|
+
| `isSubjectBuilder` | function | `(value: unknown) => value is SubjectBuilderInterface` | Determines whether a value is a `SubjectBuilder` entity — the brand-guarded stateful workspace, not the plain `Subject` data record. |
|
|
273
273
|
|
|
274
274
|
### Errors
|
|
275
275
|
|
|
276
|
-
|
|
|
277
|
-
| --------------- | -------- | --------------------------------------------------- |
|
|
278
|
-
| `ReasonError` | class | Represents an error thrown by the reasons layer. |
|
|
279
|
-
| `isReasonError` | function | Narrows an unknown caught value to a `ReasonError`. |
|
|
276
|
+
| Name | Kind | Signature | Summary |
|
|
277
|
+
| --------------- | -------- | ---------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
|
|
278
|
+
| `ReasonError` | class | `new (code: ReasonErrorCode, message: string, context?: Readonly<Record<string, unknown>>) => ReasonError` | Represents an error thrown by the reasons layer. |
|
|
279
|
+
| `isReasonError` | function | `(value: unknown) => value is ReasonError` | Narrows an unknown caught value to a `ReasonError`. |
|
|
280
280
|
|
|
281
281
|
`ReasonError` carries an own non-enumerable, non-writable, self-valued brand under `Symbol.for('@orkestrel/reason.ReasonError')`. Its guard accepts errors from another installed copy and subclasses regardless of `name`. It requires an instance of the global `Error` with a prototype other than `Error.prototype`, the own brand, a declared `code`, and valid members. It rejects unbranded look-alikes, transparent proxies, and plain objects carrying only the brand. Hostile reads return false.
|
|
282
282
|
|
|
@@ -284,25 +284,25 @@ In a guard table a `Shape` cell holds the type the guard narrows to.
|
|
|
284
284
|
|
|
285
285
|
A `Shape` cell holds the constant's declared type.
|
|
286
286
|
|
|
287
|
-
|
|
|
287
|
+
| Name | Kind | Signature | Summary |
|
|
288
288
|
| -------------------------- | ----- | ---------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
289
|
-
| `DEFAULT_REASON_BAIL` | const | `
|
|
290
|
-
| `DEFAULT_VALIDATE` | const | `
|
|
291
|
-
| `DEFAULT_DEPTH` | const | `
|
|
292
|
-
| `DEFAULT_BASE` | const | `
|
|
293
|
-
| `DEFAULT_PRECISION` | const | `
|
|
294
|
-
| `DEFAULT_CONFIDENCE` | const | `
|
|
295
|
-
| `DEFAULT_WEIGHT` | const | `
|
|
296
|
-
| `DEFAULT_PRIORITY` | const | `
|
|
297
|
-
| `CONFIDENCE_PRECISION` | const | `
|
|
289
|
+
| `DEFAULT_REASON_BAIL` | const | `true` | Holds the default `bail` for the `Reason` orchestrator — a reasoner throw is rethrown after the `error` emit. Default: `true`. |
|
|
290
|
+
| `DEFAULT_VALIDATE` | const | `false` | Holds the default `validate` for the `Reason` orchestrator — per-call validation is skipped. Default: `false`. |
|
|
291
|
+
| `DEFAULT_DEPTH` | const | `10` | Holds the default `depth` for chaining definitions — the forward-iteration / backward-recursion cap of the logical and inferential reasoners. Default: `10`. |
|
|
292
|
+
| `DEFAULT_BASE` | const | `0` | Holds the default `base` added before aggregation, at both group and definition level. Default: `0`. |
|
|
293
|
+
| `DEFAULT_PRECISION` | const | `4` | Holds the default `precision` (decimal places) for quantitative values and symbolic solutions. Default: `4`. |
|
|
294
|
+
| `DEFAULT_CONFIDENCE` | const | `1` | Holds the default `confidence` for facts, inferences, and injected subject facts. Default: `1`. |
|
|
295
|
+
| `DEFAULT_WEIGHT` | const | `1` | Holds the default factor `weight` at group aggregation. Default: `1`. |
|
|
296
|
+
| `DEFAULT_PRIORITY` | const | `0` | Holds the default factor / rule `priority` — evaluation order is ascending and stable. Default: `0`. |
|
|
297
|
+
| `CONFIDENCE_PRECISION` | const | `4` | Holds the decimal places a derived fact's confidence is rounded to during forward inferential chaining. |
|
|
298
298
|
| `INVERTIBLE_OPERATIONS` | const | `ReadonlySet<MathOperation>` | Lists the math operations the symbolic reasoner can invert while isolating a target variable — anything else (a `power`, an `abs`) fails the equation with a non-invertible error. |
|
|
299
|
-
| `EVALUATOR_ID` | const | `
|
|
300
|
-
| `TRANSFORMER_ID` | const | `
|
|
301
|
-
| `AGGREGATOR_ID` | const | `
|
|
302
|
-
| `QUANTITATIVE_ID` | const | `
|
|
303
|
-
| `LOGICAL_ID` | const | `
|
|
304
|
-
| `SYMBOLIC_ID` | const | `
|
|
305
|
-
| `INFERENTIAL_ID` | const | `
|
|
299
|
+
| `EVALUATOR_ID` | const | `"evaluator"` | Names the default `id` for an `Evaluator`. |
|
|
300
|
+
| `TRANSFORMER_ID` | const | `"transformer"` | Names the default `id` for a `Transformer`. |
|
|
301
|
+
| `AGGREGATOR_ID` | const | `"aggregator"` | Names the default `id` for an `Aggregator`. |
|
|
302
|
+
| `QUANTITATIVE_ID` | const | `"quantitative"` | Names the default `id` for a `QuantitativeReasoner`. |
|
|
303
|
+
| `LOGICAL_ID` | const | `"logical"` | Names the default `id` for a `LogicalReasoner`. |
|
|
304
|
+
| `SYMBOLIC_ID` | const | `"symbolic"` | Names the default `id` for a `SymbolicReasoner`. |
|
|
305
|
+
| `INFERENTIAL_ID` | const | `"inferential"` | Names the default `id` for an `InferentialReasoner`. |
|
|
306
306
|
| `DEFINITION_BUILDER_BRAND` | const | `unique symbol` | Holds the `DefinitionBuilder` entity brand — a `unique symbol` key carrying `readonly true` on every `DefinitionBuilderInterface` instance. |
|
|
307
307
|
| `SUBJECT_BUILDER_BRAND` | const | `unique symbol` | Holds the `SubjectBuilder` entity brand — a `unique symbol` key carrying `readonly true` on every `SubjectBuilderInterface` instance. |
|
|
308
308
|
|
|
@@ -310,102 +310,102 @@ A `Shape` cell holds the constant's declared type.
|
|
|
310
310
|
|
|
311
311
|
A `Shape` cell holds an interface's data members as bare names in braces, `?` marking an optional member and `plus` introducing its call-signature members, and a type alias's own type literal with a union's arms escaped as `\|`.
|
|
312
312
|
|
|
313
|
-
|
|
|
314
|
-
| ----------------------------- | --------- |
|
|
315
|
-
| `Reasoning` | type | `'quantitative' \| 'logical' \| 'symbolic' \| 'inferential'`
|
|
316
|
-
| `ChainStrategy` | type | `'forward' \| 'backward'`
|
|
317
|
-
| `MathOperation` | type | `'add' \| 'subtract' \| 'multiply' \| 'divide' \| 'percentage' \| 'minimum' \| 'maximum' \| 'average' \| 'power' \| 'round' \| 'ceil' \| 'floor' \| 'abs'`
|
|
318
|
-
| `Aggregation` | type | `'sum' \| 'product' \| 'average' \| 'minimum' \| 'maximum'`
|
|
319
|
-
| `Comparison` | type | `'equals' \| 'not' \| 'above' \| 'below' \| 'from' \| 'to' \| 'any' \| 'none' \| 'between' \| 'outside'`
|
|
320
|
-
| `LogicalOperator` | type | `'and' \| 'or' \| 'not' \| 'implies' \| 'xor'`
|
|
321
|
-
| `Subject` | type | `Readonly<Record<string, unknown>>`
|
|
322
|
-
| `Check` | interface | `{ field, operator, value }`
|
|
323
|
-
| `CheckResult` | interface | `{ field, met, actual, error? }`
|
|
324
|
-
| `Transform` | interface | `{ operation, operand? }`
|
|
325
|
-
| `Bounds` | interface | `{ minimum?, maximum? }`
|
|
326
|
-
| `StaticSource` | interface | `{ origin, value }`
|
|
327
|
-
| `FieldSource` | interface | `{ origin, field }`
|
|
328
|
-
| `LookupSource` | interface | `{ origin, field, table }`
|
|
329
|
-
| `RangeSource` | interface | `{ origin, field, ranges }`
|
|
330
|
-
| `Source` | type | `StaticSource \| FieldSource \| LookupSource \| RangeSource`
|
|
331
|
-
| `FactorRange` | interface | `{ bounds?, value }`
|
|
332
|
-
| `Factor` | interface | `{ id, name, description?, source, fallback?, checks?, transforms?, bounds?, weight?, priority?, enabled?, required? }`
|
|
333
|
-
| `FactorGroup` | interface | `{ id, name, description?, factors, aggregation, base?, bounds?, enabled?, strict? }`
|
|
334
|
-
| `QuantitativeDefinition` | interface | `{ reasoning, id, name, description?, groups, aggregation, base?, bounds?, precision? }`
|
|
335
|
-
| `Atom` | interface | `{ form, check }`
|
|
336
|
-
| `Compound` | interface | `{ form, operator, operands }`
|
|
337
|
-
| `Expression` | type | `Atom \| Compound`
|
|
338
|
-
| `Rule` | interface | `{ id, name, description?, premises, conclusion, priority?, enabled? }`
|
|
339
|
-
| `LogicalDefinition` | interface | `{ reasoning, id, name, description?, rules, strategy, depth? }`
|
|
340
|
-
| `Variable` | interface | `{ form, name }`
|
|
341
|
-
| `Constant` | interface | `{ form, value }`
|
|
342
|
-
| `Operation` | interface | `{ form, operator, left, right? }`
|
|
343
|
-
| `SymbolicExpression` | type | `Variable \| Constant \| Operation`
|
|
344
|
-
| `Equation` | interface | `{ id, name, description?, left, right, target }`
|
|
345
|
-
| `SymbolicDefinition` | interface | `{ reasoning, id, name, description?, equations, variables, precision? }`
|
|
346
|
-
| `Fact` | interface | `{ id, predicate, terms, confidence? }`
|
|
347
|
-
| `Inference` | interface | `{ id, name, description?, premises, conclusion, confidence?, enabled? }`
|
|
348
|
-
| `InferentialDefinition` | interface | `{ reasoning, id, name, description?, inferences, facts, strategy, depth? }`
|
|
349
|
-
| `Definition` | type | `QuantitativeDefinition \| LogicalDefinition \| SymbolicDefinition \| InferentialDefinition`
|
|
350
|
-
| `DefinitionEnvelope` | type | `Omit<QuantitativeDefinition, 'groups'> \| Omit<LogicalDefinition, 'rules'> \| Omit<SymbolicDefinition, 'equations' \| 'variables'> \| Omit<InferentialDefinition, 'facts' \| 'inferences'>`
|
|
351
|
-
| `QuantitativeClearKey` | type | `'description' \| 'base' \| 'bounds' \| 'precision'`
|
|
352
|
-
| `LogicalClearKey` | type | `'description' \| 'depth'`
|
|
353
|
-
| `SymbolicClearKey` | type | `'description' \| 'precision'`
|
|
354
|
-
| `InferentialClearKey` | type | `'description' \| 'depth'`
|
|
355
|
-
| `LogicalChainResult` | interface | `{ conclusion, rules }`
|
|
356
|
-
| `InferentialChainResult` | interface | `{ derived, proof? }`
|
|
357
|
-
| `FactorResult` | interface | `{ id, applied, value, raw?, checks? }`
|
|
358
|
-
| `GroupResult` | interface | `{ id, applied, value, factors }`
|
|
359
|
-
| `QuantitativeResult` | interface | `{ reasoning, value, groups, count, success, trace, errors }`
|
|
360
|
-
| `RuleResult` | interface | `{ id, applied, premises }`
|
|
361
|
-
| `LogicalResult` | interface | `{ reasoning, conclusion, rules, count, success, trace, errors }`
|
|
362
|
-
| `SymbolicResult` | interface | `{ reasoning, solutions, success, trace, errors }`
|
|
363
|
-
| `ProofNode` | interface | `{ fact, inference?, children?, depth }`
|
|
364
|
-
| `InferentialResult` | interface | `{ reasoning, derived, proof?, success, trace, errors }`
|
|
365
|
-
| `ReasonResult` | type | `QuantitativeResult \| LogicalResult \| SymbolicResult \| InferentialResult`
|
|
366
|
-
| `ReasonValidationResult` | interface | `{ valid, errors, warnings }`
|
|
367
|
-
| `EvaluatorOptions` | interface | `{ id? }`
|
|
368
|
-
| `TransformerOptions` | interface | `{ id? }`
|
|
369
|
-
| `AggregatorOptions` | interface | `{ id? }`
|
|
370
|
-
| `QuantitativeReasonerOptions` | interface | `{ id?, evaluator?, transformer?, aggregator? }`
|
|
371
|
-
| `LogicalReasonerOptions` | interface | `{ id?, evaluator? }`
|
|
372
|
-
| `SymbolicReasonerOptions` | interface | `{ id? }`
|
|
373
|
-
| `InferentialReasonerOptions` | interface | `{ id? }`
|
|
374
|
-
| `EvaluatorInterface` | interface | `{ id
|
|
375
|
-
| `TransformerInterface` | interface | `{ id
|
|
376
|
-
| `AggregatorInterface` | interface | `{ id }
|
|
377
|
-
| `ReasonerInterface` | interface | `{ id, reasoning
|
|
378
|
-
| `ReasonErrorCode` | type | `'MISSING' \| 'INVALID' \| 'MISMATCH' \| 'DESTROYED' \| 'TARGET' \| 'OPERATOR'`
|
|
379
|
-
| `ReasonEventMap` | type | `{ register
|
|
380
|
-
| `ReasonOptions` | interface | `{ reasoners?, bail?, validate?, on?, error? }`
|
|
381
|
-
| `ReasonInterface` | interface | `{ emitter
|
|
382
|
-
| `GroupManagerInterface` | interface | `{ emitter
|
|
383
|
-
| `GroupManagerEventMap` | type | `{ append
|
|
384
|
-
| `GroupManagerOptions` | interface | `{ groups?, on?, error? }`
|
|
385
|
-
| `FactorManagerInterface` | interface | `{ emitter
|
|
386
|
-
| `FactorManagerEventMap` | type | `{ append
|
|
387
|
-
| `FactorManagerOptions` | interface | `{ on?, error? }`
|
|
388
|
-
| `RuleManagerInterface` | interface | `{ emitter
|
|
389
|
-
| `RuleManagerEventMap` | type | `{ append
|
|
390
|
-
| `RuleManagerOptions` | interface | `{ rules?, on?, error? }`
|
|
391
|
-
| `EquationManagerInterface` | interface | `{ emitter
|
|
392
|
-
| `EquationManagerEventMap` | type | `{ append
|
|
393
|
-
| `EquationManagerOptions` | interface | `{ equations?, on?, error? }`
|
|
394
|
-
| `FactManagerInterface` | interface | `{ emitter
|
|
395
|
-
| `FactManagerEventMap` | type | `{ append
|
|
396
|
-
| `FactManagerOptions` | interface | `{ facts?, on?, error? }`
|
|
397
|
-
| `InferenceManagerInterface` | interface | `{ emitter
|
|
398
|
-
| `InferenceManagerEventMap` | type | `{ append
|
|
399
|
-
| `InferenceManagerOptions` | interface | `{ inferences?, on?, error? }`
|
|
400
|
-
| `VariableManagerInterface` | interface | `{ emitter
|
|
401
|
-
| `VariableManagerEventMap` | type | `{ add
|
|
402
|
-
| `VariableManagerOptions` | interface | `{ variables?, on?, error? }`
|
|
403
|
-
| `DefinitionBuilderEventMap` | type | `{ merge
|
|
404
|
-
| `DefinitionBuilderInterface` | interface | `{ [DEFINITION_BUILDER_BRAND], id, reasoning, emitter, groups, factors, rules, equations, variables, facts, inferences
|
|
405
|
-
| `DefinitionBuilderOptions` | interface | `{ id?, groups?, factors?, rules?, equations?, variables?, facts?, inferences?, on?, error? }`
|
|
406
|
-
| `SubjectBuilderEventMap` | type | `{ set, remove
|
|
407
|
-
| `SubjectBuilderInterface` | interface | `{ [SUBJECT_BUILDER_BRAND], id, emitter
|
|
408
|
-
| `SubjectBuilderOptions` | interface | `{ id?, on?, error? }`
|
|
313
|
+
| Name | Kind | Signature | Summary |
|
|
314
|
+
| ----------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
315
|
+
| `Reasoning` | type | `'quantitative' \| 'logical' \| 'symbolic' \| 'inferential'` | Names the reasoning strategies — the axis a `Definition` and a `ReasonResult` discriminate on. |
|
|
316
|
+
| `ChainStrategy` | type | `'forward' \| 'backward'` | Names how a chaining reasoner walks its rules: `forward` (data-driven fixpoint) or `backward` (goal-driven proving). |
|
|
317
|
+
| `MathOperation` | type | `'add' \| 'subtract' \| 'multiply' \| 'divide' \| 'percentage' \| 'minimum' \| 'maximum' \| 'average' \| 'power' \| 'round' \| 'ceil' \| 'floor' \| 'abs'` | Names a math operation applied by the `TransformerInterface` and inside `SymbolicExpression` trees. |
|
|
318
|
+
| `Aggregation` | type | `'sum' \| 'product' \| 'average' \| 'minimum' \| 'maximum'` | Names how the `AggregatorInterface` reduces a list of numbers to one. |
|
|
319
|
+
| `Comparison` | type | `'equals' \| 'not' \| 'above' \| 'below' \| 'from' \| 'to' \| 'any' \| 'none' \| 'between' \| 'outside'` | Names the comparison a `Check` applies between a resolved subject field and its expected value. |
|
|
320
|
+
| `LogicalOperator` | type | `'and' \| 'or' \| 'not' \| 'implies' \| 'xor'` | Names a logical connective inside a compound `Expression`. |
|
|
321
|
+
| `Subject` | type | `Readonly<Record<string, unknown>>` | Represents the data record being reasoned about — a plain readonly bag of fields, read by `FieldPath`. |
|
|
322
|
+
| `Check` | interface | `{ field, operator, value }` | Represents a single field predicate: resolves `field` from the subject and compares it to `value` with `operator`. |
|
|
323
|
+
| `CheckResult` | interface | `{ field, met, actual, error? }` | Represents the outcome of one `Check` evaluation. |
|
|
324
|
+
| `Transform` | interface | `{ operation, operand? }` | Represents one math step applied to a number by the `TransformerInterface`. |
|
|
325
|
+
| `Bounds` | interface | `{ minimum?, maximum? }` | Represents an inclusive numeric clamp — either side may be absent (unbounded). |
|
|
326
|
+
| `StaticSource` | interface | `{ origin, value }` | Represents a factor source yielding a fixed number. |
|
|
327
|
+
| `FieldSource` | interface | `{ origin, field }` | Represents a factor source reading a subject field as a number. |
|
|
328
|
+
| `LookupSource` | interface | `{ origin, field, table }` | Represents a factor source mapping a subject field through a lookup table. |
|
|
329
|
+
| `RangeSource` | interface | `{ origin, field, ranges }` | Represents a factor source banding a numeric subject field through ordered ranges. |
|
|
330
|
+
| `Source` | type | `StaticSource \| FieldSource \| LookupSource \| RangeSource` | Represents a static, field, lookup, or range factor source, discriminated by `origin`. |
|
|
331
|
+
| `FactorRange` | interface | `{ bounds?, value }` | Represents one band of a `RangeSource` — an optional inclusive bounds test and the value it yields. |
|
|
332
|
+
| `Factor` | interface | `{ id, name, description?, source, fallback?, checks?, transforms?, bounds?, weight?, priority?, enabled?, required? }` | Represents one scored input of a quantitative group. |
|
|
333
|
+
| `FactorGroup` | interface | `{ id, name, description?, factors, aggregation, base?, bounds?, enabled?, strict? }` | Represents a group of factors aggregated into one value. |
|
|
334
|
+
| `QuantitativeDefinition` | interface | `{ reasoning, id, name, description?, groups, aggregation, base?, bounds?, precision? }` | Defines factor-based numeric scoring. |
|
|
335
|
+
| `Atom` | interface | `{ form, check }` | Represents a leaf boolean expression — one `Check` against the subject. |
|
|
336
|
+
| `Compound` | interface | `{ form, operator, operands }` | Represents a compound boolean expression — a `LogicalOperator` over nested operands. |
|
|
337
|
+
| `Expression` | type | `Atom \| Compound` | Represents a boolean expression tree, discriminated by `form`. |
|
|
338
|
+
| `Rule` | interface | `{ id, name, description?, premises, conclusion, priority?, enabled? }` | Represents one deduction rule: when every premise holds, the `conclusion`'s atoms are asserted as derived facts. |
|
|
339
|
+
| `LogicalDefinition` | interface | `{ reasoning, id, name, description?, rules, strategy, depth? }` | Defines rule-based deduction. |
|
|
340
|
+
| `Variable` | interface | `{ form, name }` | Represents a symbolic expression leaf naming a variable. |
|
|
341
|
+
| `Constant` | interface | `{ form, value }` | Represents a symbolic expression leaf holding a fixed number. |
|
|
342
|
+
| `Operation` | interface | `{ form, operator, left, right? }` | Represents a symbolic operation node. |
|
|
343
|
+
| `SymbolicExpression` | type | `Variable \| Constant \| Operation` | Represents an algebraic expression tree, discriminated by `form`. |
|
|
344
|
+
| `Equation` | interface | `{ id, name, description?, left, right, target }` | Represents one equation `left = right`, solved for the `target` variable. |
|
|
345
|
+
| `SymbolicDefinition` | interface | `{ reasoning, id, name, description?, equations, variables, precision? }` | Defines equation-solving. |
|
|
346
|
+
| `Fact` | interface | `{ id, predicate, terms, confidence? }` | Represents one fact: a `predicate` over positional `terms`. |
|
|
347
|
+
| `Inference` | interface | `{ id, name, description?, premises, conclusion, confidence?, enabled? }` | Represents one inference rule: when every premise pattern unifies against known facts (with consistent variable bindings), the instantiated `conclusion` is derived. |
|
|
348
|
+
| `InferentialDefinition` | interface | `{ reasoning, id, name, description?, inferences, facts, strategy, depth? }` | Defines fact-derivation. |
|
|
349
|
+
| `Definition` | type | `QuantitativeDefinition \| LogicalDefinition \| SymbolicDefinition \| InferentialDefinition` | Represents any reasoning definition, discriminated by `reasoning`. |
|
|
350
|
+
| `DefinitionEnvelope` | type | `Omit<QuantitativeDefinition, 'groups'> \| Omit<LogicalDefinition, 'rules'> \| Omit<SymbolicDefinition, 'equations' \| 'variables'> \| Omit<InferentialDefinition, 'facts' \| 'inferences'>` | Represents the scalar-only projection of each definition kind — the `DefinitionBuilderInterface` implementation's private envelope holds the non-collection fields; `build()` re-composes the kind's collections from the managers' plural accessors. |
|
|
351
|
+
| `QuantitativeClearKey` | type | `'description' \| 'base' \| 'bounds' \| 'precision'` | Names the optional `QuantitativeDefinition` fields `clearQuantitativeDefinition` (and a quantitative `DefinitionBuilderInterface`'s `clear`) can delete. |
|
|
352
|
+
| `LogicalClearKey` | type | `'description' \| 'depth'` | Names the optional `LogicalDefinition` fields `clearLogicalDefinition` (and a logical `DefinitionBuilderInterface`'s `clear`) can delete. |
|
|
353
|
+
| `SymbolicClearKey` | type | `'description' \| 'precision'` | Names the optional `SymbolicDefinition` fields `clearSymbolicDefinition` (and a symbolic `DefinitionBuilderInterface`'s `clear`) can delete. |
|
|
354
|
+
| `InferentialClearKey` | type | `'description' \| 'depth'` | Names the optional `InferentialDefinition` fields `clearInferentialDefinition` (and an inferential `DefinitionBuilderInterface`'s `clear`) can delete. |
|
|
355
|
+
| `LogicalChainResult` | interface | `{ conclusion, rules }` | Represents one chaining pass of the `LogicalReasoner` — the overall `conclusion` plus the per-rule results the pass produced. |
|
|
356
|
+
| `InferentialChainResult` | interface | `{ derived, proof? }` | Represents one chaining pass of the `InferentialReasoner` — the facts the pass derived plus the proof tree, when the pass produced one. |
|
|
357
|
+
| `FactorResult` | interface | `{ id, applied, value, raw?, checks? }` | Represents one factor's evaluation outcome. |
|
|
358
|
+
| `GroupResult` | interface | `{ id, applied, value, factors }` | Represents one group's evaluation outcome — its clamped value and the per-factor results (disabled factors omitted entirely). |
|
|
359
|
+
| `QuantitativeResult` | interface | `{ reasoning, value, groups, count, success, trace, errors }` | Represents the outcome of quantitative reasoning. |
|
|
360
|
+
| `RuleResult` | interface | `{ id, applied, premises }` | Represents one rule's evaluation outcome. |
|
|
361
|
+
| `LogicalResult` | interface | `{ reasoning, conclusion, rules, count, success, trace, errors }` | Represents the outcome of logical reasoning. |
|
|
362
|
+
| `SymbolicResult` | interface | `{ reasoning, solutions, success, trace, errors }` | Represents the outcome of symbolic reasoning — final bindings keyed by each equation's `target` (a failed equation's target still appears when bound elsewhere). |
|
|
363
|
+
| `ProofNode` | interface | `{ fact, inference?, children?, depth }` | Represents one node of a backward-chaining proof tree. |
|
|
364
|
+
| `InferentialResult` | interface | `{ reasoning, derived, proof?, success, trace, errors }` | Represents the outcome of inferential reasoning. |
|
|
365
|
+
| `ReasonResult` | type | `QuantitativeResult \| LogicalResult \| SymbolicResult \| InferentialResult` | Represents any reasoning result, discriminated by `reasoning`. |
|
|
366
|
+
| `ReasonValidationResult` | interface | `{ valid, errors, warnings }` | Represents the outcome of validating a definition — hard `errors` (definition unusable) and soft `warnings` (suspicious but runnable). `valid` is `true` exactly when `errors` is empty. |
|
|
367
|
+
| `EvaluatorOptions` | interface | `{ id? }` | Configures `createEvaluator` / the `Evaluator` constructor. |
|
|
368
|
+
| `TransformerOptions` | interface | `{ id? }` | Configures `createTransformer` / the `Transformer` constructor. |
|
|
369
|
+
| `AggregatorOptions` | interface | `{ id? }` | Configures `createAggregator` / the `Aggregator` constructor. |
|
|
370
|
+
| `QuantitativeReasonerOptions` | interface | `{ id?, evaluator?, transformer?, aggregator? }` | Configures `createQuantitativeReasoner` / the `QuantitativeReasoner` constructor. |
|
|
371
|
+
| `LogicalReasonerOptions` | interface | `{ id?, evaluator? }` | Configures `createLogicalReasoner` / the `LogicalReasoner` constructor. |
|
|
372
|
+
| `SymbolicReasonerOptions` | interface | `{ id? }` | Configures `createSymbolicReasoner` / the `SymbolicReasoner` constructor. |
|
|
373
|
+
| `InferentialReasonerOptions` | interface | `{ id? }` | Configures `createInferentialReasoner` / the `InferentialReasoner` constructor. |
|
|
374
|
+
| `EvaluatorInterface` | interface | `{ id, evaluate(), batch() }` | Evaluates `Check`s against subjects. |
|
|
375
|
+
| `TransformerInterface` | interface | `{ id, apply(), chain() }` | Applies math `Transform`s to numbers. |
|
|
376
|
+
| `AggregatorInterface` | interface | `{ id, aggregate() }` | Reduces number lists to one number per `Aggregation`. |
|
|
377
|
+
| `ReasonerInterface` | interface | `{ id, reasoning, supports(), validate(), reason() }` | Declares a reasoning strategy adapter — one per `Reasoning`. |
|
|
378
|
+
| `ReasonErrorCode` | type | `'MISSING' \| 'INVALID' \| 'MISMATCH' \| 'DESTROYED' \| 'TARGET' \| 'OPERATOR'` | Names a machine-readable `ReasonError` code. |
|
|
379
|
+
| `ReasonEventMap` | type | `{ readonly register: readonly [reasoning: Reasoning]; readonly reason: readonly [result: ReasonResult]; readonly error: readonly [error: unknown]; readonly destroy: readonly []; }` | Represents the push observation surface of a `ReasonInterface`. |
|
|
380
|
+
| `ReasonOptions` | interface | `{ reasoners?, bail?, validate?, on?, error? }` | Configures `createReason` / the `Reason` constructor. |
|
|
381
|
+
| `ReasonInterface` | interface | `{ emitter, reason(), register(), reasoner(), reasoners(), supports(), validate(), destroy() }` | Declares the reasoning orchestrator — a thin router over registered `ReasonerInterface`s. |
|
|
382
|
+
| `GroupManagerInterface` | interface | `{ emitter, group(), groups(), append(), prepend(), replace(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over a quantitative definition's `groups` — a self-owning, kind-free collection manager. |
|
|
383
|
+
| `GroupManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `GroupManagerInterface`. |
|
|
384
|
+
| `GroupManagerOptions` | interface | `{ groups?, on?, error? }` | Configures `createGroupManager` / the `GroupManager` constructor. |
|
|
385
|
+
| `FactorManagerInterface` | interface | `{ emitter, factor(), factors(), append(), prepend(), replace(), remove(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over a `FactorGroup`'s `factors`, threaded through the required `groupId` locator (a factor lives inside its group). |
|
|
386
|
+
| `FactorManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `FactorManagerInterface`. |
|
|
387
|
+
| `FactorManagerOptions` | interface | `{ on?, error? }` | Configures `createFactorManager` / the `FactorManager` constructor. |
|
|
388
|
+
| `RuleManagerInterface` | interface | `{ emitter, rule(), rules(), append(), prepend(), replace(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over a logical definition's `rules` — a self-owning, kind-free collection manager. |
|
|
389
|
+
| `RuleManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `RuleManagerInterface`. |
|
|
390
|
+
| `RuleManagerOptions` | interface | `{ rules?, on?, error? }` | Configures `createRuleManager` / the `RuleManager` constructor. |
|
|
391
|
+
| `EquationManagerInterface` | interface | `{ emitter, equation(), equations(), append(), prepend(), replace(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over a symbolic definition's `equations` — a self-owning, kind-free collection manager. |
|
|
392
|
+
| `EquationManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of an `EquationManagerInterface`. |
|
|
393
|
+
| `EquationManagerOptions` | interface | `{ equations?, on?, error? }` | Configures `createEquationManager` / the `EquationManager` constructor. |
|
|
394
|
+
| `FactManagerInterface` | interface | `{ emitter, fact(), facts(), append(), prepend(), replace(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over an inferential definition's `facts` — a self-owning, kind-free collection manager. |
|
|
395
|
+
| `FactManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `FactManagerInterface`. |
|
|
396
|
+
| `FactManagerOptions` | interface | `{ facts?, on?, error? }` | Configures `createFactManager` / the `FactManager` constructor. |
|
|
397
|
+
| `InferenceManagerInterface` | interface | `{ emitter, inference(), inferences(), append(), prepend(), replace(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over an inferential definition's `inferences` — a self-owning, kind-free collection manager. |
|
|
398
|
+
| `InferenceManagerEventMap` | type | `{ readonly append: readonly [id: string]; readonly prepend: readonly [id: string]; readonly replace: readonly [id: string]; readonly remove: readonly [id: string]; readonly destroy: readonly []; }` | Represents the push observation surface of an `InferenceManagerInterface`. |
|
|
399
|
+
| `InferenceManagerOptions` | interface | `{ inferences?, on?, error? }` | Configures `createInferenceManager` / the `InferenceManager` constructor. |
|
|
400
|
+
| `VariableManagerInterface` | interface | `{ emitter, variable(), variables(), add(), remove(), seat(), destroy() }` | Declares the `DefinitionBuilderInterface` manager over a symbolic definition's `variables` — a name-keyed unordered record, so `add` / `remove` are the only write verbs (no placement). A self-owning, kind-free manager. |
|
|
401
|
+
| `VariableManagerEventMap` | type | `{ readonly add: readonly [name: string]; readonly remove: readonly [name: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `VariableManagerInterface`. |
|
|
402
|
+
| `VariableManagerOptions` | interface | `{ variables?, on?, error? }` | Configures `createVariableManager` / the `VariableManager` constructor. |
|
|
403
|
+
| `DefinitionBuilderEventMap` | type | `{ readonly merge: readonly [reasoning: Reasoning]; readonly clear: readonly [key: string]; readonly destroy: readonly []; }` | Represents the push observation surface of a `DefinitionBuilderInterface` — the builder-level lifecycle events; per-element mutation events live on the individual managers' own emitters. |
|
|
404
|
+
| `DefinitionBuilderInterface` | interface | `{ [DEFINITION_BUILDER_BRAND], id, reasoning, emitter, groups, factors, rules, equations, variables, facts, inferences, build(), merge(), clear(), destroy() }` | Declares a stateful workspace builder accumulating a `Definition` through always-present self-owning manager properties: a private scalar envelope plus one manager per collection. |
|
|
405
|
+
| `DefinitionBuilderOptions` | interface | `{ id?, groups?, factors?, rules?, equations?, variables?, facts?, inferences?, on?, error? }` | Configures `createDefinitionBuilder` / the `DefinitionBuilder` constructor. |
|
|
406
|
+
| `SubjectBuilderEventMap` | type | `{ readonly set: readonly [key: string, value: unknown]; readonly remove: readonly [key: string]; readonly merge: readonly [incoming: Subject]; readonly clear: readonly []; readonly destroy: readonly []; }` | Represents the push observation surface of a `SubjectBuilderInterface` — the verb-named `set`, `remove`, `merge`, `clear`, and `destroy` events, no generic `change` / `status`. |
|
|
407
|
+
| `SubjectBuilderInterface` | interface | `{ [SUBJECT_BUILDER_BRAND], id, emitter, field(), fields(), set(), remove(), merge(), clear(), repeat(), build(), destroy() }` | Declares a stateful workspace builder accumulating a `Subject` — one flat key-value collection, no managers. |
|
|
408
|
+
| `SubjectBuilderOptions` | interface | `{ id?, on?, error? }` | Configures `createSubjectBuilder` / the `SubjectBuilder` constructor. |
|
|
409
409
|
|
|
410
410
|
## Methods
|
|
411
411
|
|