@kortexya/reasoninglayer 1.24.0 → 1.25.0

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/index.d.cts CHANGED
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
109
109
  * This is the single source of truth for the version constant.
110
110
  * The `scripts/release.sh` script updates this value alongside `package.json`.
111
111
  */
112
- declare const SDK_VERSION = "1.24.0";
112
+ declare const SDK_VERSION = "1.25.0";
113
113
  /**
114
114
  * Authentication mode for the SDK.
115
115
  *
@@ -2646,7 +2646,7 @@ interface BindingSummaryDto$1 {
2646
2646
  * uniqueness constraint backs it or an operator ticked it, and those two
2647
2647
  * have opposite durability.
2648
2648
  */
2649
- key_provenance: KeyProvenanceDto;
2649
+ key_provenance: KeyProvenanceDto$1;
2650
2650
  /** Sort ID (UUID string). */
2651
2651
  sort_id: string;
2652
2652
  /**
@@ -8053,7 +8053,7 @@ interface DiscoveredFeatureDto$1 {
8053
8053
  * rebuild of the source: a uniqueness constraint does, a graph's internal
8054
8054
  * record id does not.
8055
8055
  */
8056
- identifier_provenance?: null | KeyProvenanceDto;
8056
+ identifier_provenance?: null | KeyProvenanceDto$1;
8057
8057
  /** Whether the field is a primary key/identifier */
8058
8058
  is_identifier: boolean;
8059
8059
  /** Whether the field is a relation */
@@ -11417,7 +11417,23 @@ type FeatureTypeDto$1 = "string" | "integer" | "real" | "boolean" | "reference"
11417
11417
  * - null
11418
11418
  * - array of FeatureValueDto
11419
11419
  */
11420
- type FeatureValueDto$1 = string | number | boolean | null | FeatureValueDto$1[];
11420
+ type FeatureValueDto$1 = {
11421
+ term_id: string;
11422
+ var_name: string;
11423
+ } | {
11424
+ /**
11425
+ * Feature value in a Ψ-term (untagged union). Can be:
11426
+ * - UUID string (term reference)
11427
+ * - string value
11428
+ * - integer (i64)
11429
+ * - number (f64)
11430
+ * - boolean
11431
+ * - null
11432
+ * - array of FeatureValueDto
11433
+ */
11434
+ literal: FeatureValueDto$1;
11435
+ term_id: string;
11436
+ } | string | number | boolean | null | FeatureValueDto$1[];
11421
11437
  /** Request to finalize a live oversight session. */
11422
11438
  interface FinalizeSessionRequest {
11423
11439
  /** Optional execution log (for full provenance) */
@@ -12099,6 +12115,37 @@ type FunctionBodyDto$1 = {
12099
12115
  program: string;
12100
12116
  type: "Neural";
12101
12117
  };
12118
+ /** One thing that calls a function. */
12119
+ interface FunctionCallerDto {
12120
+ /** Where the reference lives. */
12121
+ kind: FunctionCallerKind$1;
12122
+ /**
12123
+ * The calling function's name, or the rule conclusion's display, so a
12124
+ * refusal names something the caller can find.
12125
+ */
12126
+ name: string;
12127
+ /**
12128
+ * Term id of the calling rule's conclusion, or of the `function_call`
12129
+ * goal term when no rule holds it. Absent for a function caller, which is
12130
+ * identified by name.
12131
+ * @format uuid
12132
+ */
12133
+ term_id?: string | null;
12134
+ }
12135
+ /** What names a function — where the reference lives. */
12136
+ type FunctionCallerKind$1 = "function" | "rule";
12137
+ /**
12138
+ * What `DELETE /api/v1/functions/{name}` does about the things that CALL the
12139
+ * function.
12140
+ *
12141
+ * A function is reachable by name from two places: another registered
12142
+ * function's clause body (`FunctionCall`), and a rule's `function_call` goal.
12143
+ * Removing it underneath either leaves the caller naming something that no
12144
+ * longer resolves, and the failure surfaces at evaluation time — which is
12145
+ * exactly what "no route at all, recover with a tenant wipe" already produced
12146
+ * and what this route exists to stop being the default.
12147
+ */
12148
+ type FunctionCallersDisposition$1 = "refuse" | "orphan";
12102
12149
  /** A single clause in a function definition */
12103
12150
  interface FunctionClauseDto$1 {
12104
12151
  /** Function body - what to compute */
@@ -12189,6 +12236,36 @@ type FunctionValueDto$1 = {
12189
12236
  } | {
12190
12237
  type: "Uninstantiated";
12191
12238
  };
12239
+ /**
12240
+ * What withdrawing a registered function removed.
12241
+ *
12242
+ * A function is carried twice — the durable `meta.function` carrier Ψ-term
12243
+ * that is the source of truth, and the evaluator's own registry used for
12244
+ * dispatch — so both are reported. Forgetting either leaves it half-alive.
12245
+ */
12246
+ interface FunctionWithdrawalReport$1 {
12247
+ /**
12248
+ * Everything that still names the function, left calling something that
12249
+ * no longer resolves. Empty on the ordinary withdrawal; non-empty only
12250
+ * under `?callers=orphan`, which is the disposition that permits it.
12251
+ */
12252
+ callers_orphaned?: FunctionCallerDto[];
12253
+ /**
12254
+ * Whether the durable `meta.function` carrier Ψ-term was deleted. `false`
12255
+ * means the function is gone from this process but its carrier survives,
12256
+ * so a restart would bring it back — the operator's cue to retry.
12257
+ */
12258
+ carrier_deleted: boolean;
12259
+ /** Whether it left the in-process registry and the evaluator. */
12260
+ deregistered: boolean;
12261
+ /**
12262
+ * Its stable id, as the registration reported it.
12263
+ * @format uuid
12264
+ */
12265
+ function_id: string;
12266
+ /** The function that was withdrawn. */
12267
+ name: string;
12268
+ }
12192
12269
  /**
12193
12270
  * Request: render the LIFE-function definitions in the tenant's
12194
12271
  * term store.
@@ -16231,7 +16308,7 @@ type KbChangeDto$1 = {
16231
16308
  * *do the term ids survive a rebuild of the source?* — are readable without
16232
16309
  * inferring anything from a column's name.
16233
16310
  */
16234
- interface KeyProvenanceDto {
16311
+ interface KeyProvenanceDto$1 {
16235
16312
  /**
16236
16313
  * Which side settled the key: `discovery`, `client`, `nobody` (a keyless
16237
16314
  * binding), or `unrecorded`.
@@ -23193,6 +23270,92 @@ interface RepairHintDto {
23193
23270
  /** The feature or predicate the hint applies to. */
23194
23271
  target: string;
23195
23272
  }
23273
+ /**
23274
+ * Request body of `PUT /api/v1/functions/{name}` — the definition that
23275
+ * replaces the one registered under the path name.
23276
+ *
23277
+ * # Why it accepts the register payload verbatim
23278
+ *
23279
+ * `POST /functions/register` takes `{tenant_id, name, arity, clauses}`, and
23280
+ * that is the payload a client already has in hand when it decides to replace
23281
+ * something. Sending it to `PUT` is the obvious move, and under
23282
+ * `deny_unknown_fields` it would answer `422 unknown field 'tenant_id'` —
23283
+ * technically correct and unhelpful, since the caller's actual question is
23284
+ * about the two `name`s (#234).
23285
+ *
23286
+ * So both are declared, and each is handled explicitly rather than dropped:
23287
+ *
23288
+ * * `tenant_id` is **accepted and ignored**, exactly as `register_function`
23289
+ * ignores it — the tenant comes from the authenticated principal, and
23290
+ * trusting a body field would let a caller write into another tenant.
23291
+ * * `name`, when present, **must equal the path's**. A mismatch is refused
23292
+ * with both names rather than silently applying the clauses to whichever
23293
+ * one the route happened to read.
23294
+ *
23295
+ * A *declared* field that is deliberately ignored is a different thing from
23296
+ * an *undeclared* key that is silently dropped. The first is a documented
23297
+ * contract; the second is the defect this issue is about.
23298
+ */
23299
+ interface ReplaceFunctionRequest {
23300
+ /**
23301
+ * The number of named arguments the replacement accepts.
23302
+ * @min 0
23303
+ */
23304
+ arity: number;
23305
+ /** The replacement's pattern-matched clauses, tried in order. */
23306
+ clauses: FunctionClauseDto$1[];
23307
+ /**
23308
+ * The function's name. Optional, and when present it must equal the
23309
+ * path's — this route replaces a definition, it does not rename one.
23310
+ *
23311
+ * A rename would keep every caller's reference pointing at the OLD name,
23312
+ * which no longer resolves; that is a withdrawal plus a registration, and
23313
+ * the caller should say so.
23314
+ */
23315
+ name?: string | null;
23316
+ /**
23317
+ * Accepted so the `register` payload works verbatim, and **ignored**: the
23318
+ * tenant is the authenticated principal's, never a body field.
23319
+ * @format uuid
23320
+ */
23321
+ tenant_id?: string | null;
23322
+ }
23323
+ /**
23324
+ * Response of `PUT /api/v1/functions/{name}`.
23325
+ *
23326
+ * # Why the previous signature is reported
23327
+ *
23328
+ * A function's identity is its NAME, so a replacement keeps every caller's
23329
+ * reference valid — which is what makes an arity change dangerous rather than
23330
+ * merely breaking: a caller passing the old number of arguments keeps
23331
+ * resolving and starts failing at evaluation time with an arity error. The
23332
+ * response names the change so a client can say so.
23333
+ */
23334
+ interface ReplaceFunctionResponse$1 {
23335
+ /**
23336
+ * `true` when the arity changed. Every caller's reference stays valid and
23337
+ * every call passing the old count now fails at evaluation time.
23338
+ */
23339
+ arity_changed: boolean;
23340
+ /**
23341
+ * Everything that calls this function. Reported rather than refused: the
23342
+ * replacement keeps the name resolvable, so a caller is not orphaned —
23343
+ * but one written against the old signature may no longer be correct.
23344
+ */
23345
+ callers?: FunctionCallerDto[];
23346
+ /** What the replacement looks like. */
23347
+ current: FunctionSummaryDto$1;
23348
+ /**
23349
+ * The replacement's id. A fresh registration mints a new one, so this
23350
+ * differs from the previous definition's.
23351
+ * @format uuid
23352
+ */
23353
+ function_id: string;
23354
+ /** The function's name — unchanged by the replacement, by construction. */
23355
+ name: string;
23356
+ /** What the replaced definition looked like. */
23357
+ previous: FunctionSummaryDto$1;
23358
+ }
23196
23359
  /**
23197
23360
  * Response of `PUT /api/v1/inference/rules/{id}`.
23198
23361
  *
@@ -24909,12 +25072,63 @@ interface RuleEntryDto$1 {
24909
25072
  certainty?: number | null;
24910
25073
  /** The head (consequent) of the rule. */
24911
25074
  head: PsiTermDto$1;
25075
+ /**
25076
+ * When [`Self::withdrawable`] is false, the refusal a withdrawal attempt
25077
+ * would produce — the same prose, and the same `code`, the mutation route
25078
+ * answers with.
25079
+ *
25080
+ * Absent for a withdrawable rule.
25081
+ */
25082
+ not_withdrawable?: null | RuleNotWithdrawableDto;
25083
+ /**
25084
+ * Where this rule came from, from the reading tenant's point of view.
25085
+ *
25086
+ * The listing deliberately returns the PLUGIN-MERGED rule set and admits
25087
+ * the reserved system tenant's rules, because they fire in every tenant's
25088
+ * proof — so three of the withdrawal route's five refusal classes describe
25089
+ * rules that appear here (#232 §1).
25090
+ */
25091
+ origin: RuleOriginDto;
24912
25092
  /**
24913
25093
  * Rule term ID.
24914
25094
  * @format uuid
24915
25095
  */
24916
25096
  rule_id: string;
25097
+ /**
25098
+ * Whether `DELETE`/`PUT` on this rule will act rather than refuse.
25099
+ *
25100
+ * Derived from the same walk the mutation routes run, so the listing and
25101
+ * the refusal cannot disagree. The engine stays the authority: a caller
25102
+ * may still be refused by a state change between this read and the write.
25103
+ */
25104
+ withdrawable: boolean;
25105
+ }
25106
+ /**
25107
+ * Why a listed rule cannot be withdrawn, in the same terms the mutation route
25108
+ * would answer with.
25109
+ */
25110
+ interface RuleNotWithdrawableDto {
25111
+ /**
25112
+ * The stable machine-readable discriminator the `DELETE` would carry —
25113
+ * `rule_system_owned`, `rule_plugin_owned` or `rule_bootstrap`.
25114
+ */
25115
+ code: string;
25116
+ /**
25117
+ * The refusal in words, naming the lifecycle operation that DOES withdraw
25118
+ * this rule.
25119
+ */
25120
+ reason: string;
24917
25121
  }
25122
+ /**
25123
+ * Where a listed rule came from.
25124
+ *
25125
+ * The client-facing projection of the engine's provenance walk. A UI keys the
25126
+ * row's actions on this rather than on `_plugin_id` — the underscore-prefixed
25127
+ * provenance meta-feature the marketplace stamps on a plugin's clauses, which
25128
+ * is documented as invisible to domain queries and cannot tell a system-wide
25129
+ * plugin from a tenant-scoped one, nor see a bootstrap rule at all.
25130
+ */
25131
+ type RuleOriginDto = "tenant" | "system_plugin" | "tenant_plugin" | "bootstrap";
24918
25132
  /** Response with rule store info */
24919
25133
  interface RuleStoreResponse$1 {
24920
25134
  /** @min 0 */
@@ -32224,20 +32438,71 @@ type FeatureTargetDto = TaggedFeatureValueDto | string;
32224
32438
  * Do NOT use with term CRUD or query endpoints — use {@link ValueDto} instead.
32225
32439
  *
32226
32440
  * The backend Rust type is `FeatureValueDto` in `dto/homoiconic.rs` with
32227
- * `#[serde(untagged)]`. Variant ordering:
32228
- * 1. TermRef (UUID string)
32229
- * 2. TermRefs/List (array of FeatureValueDto)
32230
- * 3. String
32231
- * 4. Integer (i64)
32232
- * 5. Real (f64)
32233
- * 6. Boolean
32234
- * 7. Null (uninstantiated)
32441
+ * `#[serde(untagged)]`. Variant ordering — **load-bearing**, because an
32442
+ * untagged union tries its variants in declaration order and an object with
32443
+ * extra keys still matches an earlier variant that ignores them:
32444
+ * 1. Variable (`{term_id, var_name}`)
32445
+ * 2. Literal (`{term_id, literal}`)
32446
+ * 3. TermRef (`{term_id}`)
32447
+ * 4. TermRefs/List (array of FeatureValueDto)
32448
+ * 5. String
32449
+ * 6. Integer (i64)
32450
+ * 7. Real (f64)
32451
+ * 8. Boolean
32452
+ * 9. Null (uninstantiated)
32235
32453
  *
32236
32454
  * **Ambiguity note**: UUID strings and regular strings are both `string` in TypeScript.
32237
32455
  * The backend distinguishes them by UUID format. The SDK provides
32238
32456
  * `discriminateFeatureValue()` in `utils/discrimination.ts` for response parsing.
32239
32457
  */
32240
- type FeatureValueDto = string | number | boolean | null | FeatureValueDto[];
32458
+ type FeatureValueDto = VariableFeatureValue | LiteralFeatureValue | TermRefFeatureValue | string | number | boolean | null | FeatureValueDto[];
32459
+ /**
32460
+ * A feature bound to a LOGIC VARIABLE, carrying the name the rule author wrote.
32461
+ *
32462
+ * @remarks
32463
+ * A variable and a reference to a stored term are both `Value::Reference` in
32464
+ * the engine, so both used to arrive as a bare {@link TermRefFeatureValue} —
32465
+ * nothing in a rule's features said that `name` was bound to `?N` rather than
32466
+ * to a term, and the name existed only inside the `display` prose (#232 §2).
32467
+ *
32468
+ * `termId` is the variable term's, so **two features bound to the same variable
32469
+ * carry the same id**. That is how a client reads the coreference which makes
32470
+ * `senior(name: ?N) WHEN person(name: ?N)` a join rather than two independent
32471
+ * patterns.
32472
+ */
32473
+ interface VariableFeatureValue {
32474
+ /** The variable term's UUID. Shared by every feature bound to it. */
32475
+ term_id: string;
32476
+ /** The variable's name as authored, e.g. `?N`. */
32477
+ var_name: string;
32478
+ }
32479
+ /**
32480
+ * A feature bound to an INTERNED LITERAL WRAPPER, carrying the scalar it holds.
32481
+ *
32482
+ * @remarks
32483
+ * The engine interns a guard's bound as a term — `65` becomes an
32484
+ * `integer_type` Ψ-term — so reading it used to cost one `GET /terms/{id}` per
32485
+ * guard, and the summary that exists to save that round trip named the
32486
+ * wrapper's SORT rather than its value (#232 §4).
32487
+ */
32488
+ interface LiteralFeatureValue {
32489
+ /** The wrapper term's UUID. */
32490
+ term_id: string;
32491
+ /** The scalar the wrapper holds. */
32492
+ literal: FeatureValueDto;
32493
+ }
32494
+ /**
32495
+ * A reference to another term, with nothing said about what it is.
32496
+ *
32497
+ * @remarks
32498
+ * What a reference falls back to when it is neither a named variable nor an
32499
+ * interned literal — an ordinary stored term, or an anonymous variable, which
32500
+ * carries no name to report.
32501
+ */
32502
+ interface TermRefFeatureValue {
32503
+ /** The referenced term's UUID. */
32504
+ term_id: string;
32505
+ }
32241
32506
 
32242
32507
  type values_BellShape = BellShape;
32243
32508
  type values_BooleanValue = BooleanValue;
@@ -32253,6 +32518,7 @@ type values_GaussianProductShape = GaussianProductShape;
32253
32518
  type values_GaussianShape = GaussianShape;
32254
32519
  type values_IntegerValue = IntegerValue;
32255
32520
  type values_ListValue = ListValue;
32521
+ type values_LiteralFeatureValue = LiteralFeatureValue;
32256
32522
  type values_PiShapeShape = PiShapeShape;
32257
32523
  type values_PiecewiseLinearShape = PiecewiseLinearShape;
32258
32524
  type values_RealValue = RealValue;
@@ -32266,13 +32532,15 @@ type values_SortIdValue = SortIdValue;
32266
32532
  type values_SpikeShape = SpikeShape;
32267
32533
  type values_StringValue = StringValue;
32268
32534
  type values_TaggedFeatureValueDto = TaggedFeatureValueDto;
32535
+ type values_TermRefFeatureValue = TermRefFeatureValue;
32269
32536
  type values_TrapezoidalShape = TrapezoidalShape;
32270
32537
  type values_TriangularShape = TriangularShape;
32271
32538
  type values_UninstantiatedValue = UninstantiatedValue;
32272
32539
  type values_ValueDto = ValueDto;
32540
+ type values_VariableFeatureValue = VariableFeatureValue;
32273
32541
  type values_ZShapeShape = ZShapeShape;
32274
32542
  declare namespace values {
32275
- export type { values_BellShape as BellShape, values_BooleanValue as BooleanValue, values_CauchyShape as CauchyShape, values_CosineShape as CosineShape, values_CyclicGaussianShape as CyclicGaussianShape, values_FeatureTargetDto as FeatureTargetDto, values_FeatureValueDto as FeatureValueDto, values_FuzzyNumberValue as FuzzyNumberValue, values_FuzzyScalarValue as FuzzyScalarValue, values_FuzzyShapeDto as FuzzyShapeDto, values_GaussianProductShape as GaussianProductShape, values_GaussianShape as GaussianShape, values_IntegerValue as IntegerValue, values_ListValue as ListValue, values_PiShapeShape as PiShapeShape, values_PiecewiseLinearShape as PiecewiseLinearShape, values_RealValue as RealValue, values_ReferenceValue as ReferenceValue, values_SShapeShape as SShapeShape, values_SetValue as SetValue, values_SigmoidDifferenceShape as SigmoidDifferenceShape, values_SigmoidProductShape as SigmoidProductShape, values_SigmoidShape as SigmoidShape, values_SortIdValue as SortIdValue, values_SpikeShape as SpikeShape, values_StringValue as StringValue, values_TaggedFeatureValueDto as TaggedFeatureValueDto, values_TrapezoidalShape as TrapezoidalShape, values_TriangularShape as TriangularShape, values_UninstantiatedValue as UninstantiatedValue, values_ValueDto as ValueDto, values_ZShapeShape as ZShapeShape };
32543
+ export type { values_BellShape as BellShape, values_BooleanValue as BooleanValue, values_CauchyShape as CauchyShape, values_CosineShape as CosineShape, values_CyclicGaussianShape as CyclicGaussianShape, values_FeatureTargetDto as FeatureTargetDto, values_FeatureValueDto as FeatureValueDto, values_FuzzyNumberValue as FuzzyNumberValue, values_FuzzyScalarValue as FuzzyScalarValue, values_FuzzyShapeDto as FuzzyShapeDto, values_GaussianProductShape as GaussianProductShape, values_GaussianShape as GaussianShape, values_IntegerValue as IntegerValue, values_ListValue as ListValue, values_LiteralFeatureValue as LiteralFeatureValue, values_PiShapeShape as PiShapeShape, values_PiecewiseLinearShape as PiecewiseLinearShape, values_RealValue as RealValue, values_ReferenceValue as ReferenceValue, values_SShapeShape as SShapeShape, values_SetValue as SetValue, values_SigmoidDifferenceShape as SigmoidDifferenceShape, values_SigmoidProductShape as SigmoidProductShape, values_SigmoidShape as SigmoidShape, values_SortIdValue as SortIdValue, values_SpikeShape as SpikeShape, values_StringValue as StringValue, values_TaggedFeatureValueDto as TaggedFeatureValueDto, values_TermRefFeatureValue as TermRefFeatureValue, values_TrapezoidalShape as TrapezoidalShape, values_TriangularShape as TriangularShape, values_UninstantiatedValue as UninstantiatedValue, values_ValueDto as ValueDto, values_VariableFeatureValue as VariableFeatureValue, values_ZShapeShape as ZShapeShape };
32276
32544
  }
32277
32545
 
32278
32546
  /**
@@ -33871,6 +34139,11 @@ interface FindBySortRequest {
33871
34139
  sortName?: string | null;
33872
34140
  /** Optional filter for feature-based filtering. */
33873
34141
  filter?: Record<string, string> | null;
34142
+ /**
34143
+ * Cap on the number of terms returned, applied after the filter. Omit (or
34144
+ * pass 0) for no cap.
34145
+ */
34146
+ limit?: number | null;
33874
34147
  }
33875
34148
  /**
33876
34149
  * Request to validate a term against its sort's type witnesses.
@@ -35367,6 +35640,58 @@ interface RuleEntryDto {
35367
35640
  body: PsiTermDto[];
35368
35641
  /** Optional certainty/confidence for the rule. */
35369
35642
  certainty?: number | null;
35643
+ /**
35644
+ * Where this rule came from, from the reading tenant's point of view.
35645
+ *
35646
+ * @remarks
35647
+ * The listing deliberately returns the PLUGIN-MERGED rule set and admits the
35648
+ * reserved system tenant's rules, because they fire in every tenant's proof
35649
+ * — so three of the withdrawal route's five refusal classes describe rules
35650
+ * that appear here.
35651
+ */
35652
+ origin: RuleOrigin;
35653
+ /**
35654
+ * Whether `deleteRule` / `replaceRule` will act on this rule rather than
35655
+ * refuse.
35656
+ *
35657
+ * @remarks
35658
+ * Derived from the same walk the mutation routes run, so the listing and the
35659
+ * refusal cannot disagree. The engine stays the authority: a caller may
35660
+ * still be refused by a state change between this read and the write.
35661
+ */
35662
+ withdrawable: boolean;
35663
+ /**
35664
+ * When {@link RuleEntryDto.withdrawable} is false, the refusal a withdrawal
35665
+ * would produce — the same `code` and prose the mutation route answers with.
35666
+ * Absent for a withdrawable rule.
35667
+ */
35668
+ notWithdrawable?: RuleNotWithdrawable;
35669
+ }
35670
+ /**
35671
+ * Where a listed rule came from.
35672
+ *
35673
+ * @remarks
35674
+ * A UI keys a row's actions on this rather than on `_plugin_id` — the
35675
+ * underscore-prefixed provenance meta-feature the marketplace stamps on a
35676
+ * plugin's clauses, which is documented as invisible to domain queries, cannot
35677
+ * tell a system-wide plugin from a tenant-scoped one, and sees nothing at all
35678
+ * for a bootstrap rule.
35679
+ *
35680
+ * - `tenant` — authored in this tenant. The only withdrawable origin.
35681
+ * - `system_plugin` — a system-wide plugin's rule, firing in every tenant's proof.
35682
+ * - `tenant_plugin` — contributed by a plugin installed in this tenant.
35683
+ * - `bootstrap` — engine machinery (an Allen relation, a handler mapping).
35684
+ */
35685
+ type RuleOrigin = 'tenant' | 'system_plugin' | 'tenant_plugin' | 'bootstrap';
35686
+ /** Why a listed rule cannot be withdrawn, in the mutation route's own terms. */
35687
+ interface RuleNotWithdrawable {
35688
+ /**
35689
+ * The stable discriminator the `DELETE` would carry — `rule_system_owned`,
35690
+ * `rule_plugin_owned` or `rule_bootstrap`.
35691
+ */
35692
+ code: string;
35693
+ /** The refusal in words, naming the lifecycle operation that DOES withdraw it. */
35694
+ reason: string;
35370
35695
  }
35371
35696
  /** Response listing all rules for a tenant. */
35372
35697
  interface GetRulesResponse {
@@ -35796,6 +36121,8 @@ type inference_RuleDerivationsDisposition = RuleDerivationsDisposition;
35796
36121
  type inference_RuleDraftClarificationQuestionDto = RuleDraftClarificationQuestionDto;
35797
36122
  type inference_RuleDraftDto = RuleDraftDto;
35798
36123
  type inference_RuleEntryDto = RuleEntryDto;
36124
+ type inference_RuleNotWithdrawable = RuleNotWithdrawable;
36125
+ type inference_RuleOrigin = RuleOrigin;
35799
36126
  type inference_RuleTermDraftDto = RuleTermDraftDto;
35800
36127
  type inference_RuleWithdrawalReport = RuleWithdrawalReport;
35801
36128
  type inference_SolutionDto = SolutionDto;
@@ -35803,7 +36130,7 @@ type inference_TaggedDerivedFact = TaggedDerivedFact;
35803
36130
  type inference_TaggedForwardChainRequest = TaggedForwardChainRequest;
35804
36131
  type inference_TaggedForwardChainResponse = TaggedForwardChainResponse;
35805
36132
  declare namespace inference {
35806
- export type { inference_AddFactRequest as AddFactRequest, inference_AddFactResponse as AddFactResponse, inference_AddRuleRequest as AddRuleRequest, inference_AddRuleResponse as AddRuleResponse, inference_AllenRelation as AllenRelation, inference_BackwardChainRequest as BackwardChainRequest, inference_BackwardChainResponse as BackwardChainResponse, inference_BayesianEffectDto as BayesianEffectDto, inference_BayesianPredictRequest as BayesianPredictRequest, inference_BayesianPredictResponse as BayesianPredictResponse, inference_BindingDto as BindingDto, inference_BulkAddFactsRequest as BulkAddFactsRequest, inference_BulkAddFactsResponse as BulkAddFactsResponse, inference_BulkAddRulesRequest as BulkAddRulesRequest, inference_BulkAddRulesResponse as BulkAddRulesResponse, inference_BulkFuzzyProveRequest as BulkFuzzyProveRequest, inference_BulkFuzzyProveResponse as BulkFuzzyProveResponse, inference_ClearFactsResponse as ClearFactsResponse, inference_ConstraintInputDto as ConstraintInputDto, inference_CreateGoalRequest as CreateGoalRequest, inference_CreateGoalResponse as CreateGoalResponse, inference_DeleteGoalResponse as DeleteGoalResponse, inference_DraftRulesRequest as DraftRulesRequest, inference_DraftRulesResponse as DraftRulesResponse, inference_FactConfidenceEntry as FactConfidenceEntry, inference_ForwardChainRequest as ForwardChainRequest, inference_ForwardChainResponse as ForwardChainResponse, inference_FuzzyProveRequest as FuzzyProveRequest, inference_FuzzyProveResponse as FuzzyProveResponse, inference_GetFactsResponse as GetFactsResponse, inference_GetRulesResponse as GetRulesResponse, inference_GoalDto as GoalDto, inference_GoalSummaryDto as GoalSummaryDto, inference_GuardOp as GuardOp, inference_HomoiconicSubstitutionDto as HomoiconicSubstitutionDto, inference_ListGoalsResponse as ListGoalsResponse, inference_LiteralInputDto as LiteralInputDto, inference_MetaSortsResponse as MetaSortsResponse, inference_NafProveRequest as NafProveRequest, inference_NafProveResponse as NafProveResponse, inference_ProofDto as ProofDto, inference_ProvenanceTagDto as ProvenanceTagDto, inference_ReplaceRuleResponse as ReplaceRuleResponse, inference_RuleAggregatorDto as RuleAggregatorDto, inference_RuleCertificationDelta as RuleCertificationDelta, inference_RuleDerivationsDisposition as RuleDerivationsDisposition, inference_RuleDraftClarificationQuestionDto as RuleDraftClarificationQuestionDto, inference_RuleDraftDto as RuleDraftDto, inference_RuleEntryDto as RuleEntryDto, inference_RuleTermDraftDto as RuleTermDraftDto, inference_RuleWithdrawalReport as RuleWithdrawalReport, inference_SolutionDto as SolutionDto, inference_TaggedDerivedFact as TaggedDerivedFact, inference_TaggedForwardChainRequest as TaggedForwardChainRequest, inference_TaggedForwardChainResponse as TaggedForwardChainResponse };
36133
+ export type { inference_AddFactRequest as AddFactRequest, inference_AddFactResponse as AddFactResponse, inference_AddRuleRequest as AddRuleRequest, inference_AddRuleResponse as AddRuleResponse, inference_AllenRelation as AllenRelation, inference_BackwardChainRequest as BackwardChainRequest, inference_BackwardChainResponse as BackwardChainResponse, inference_BayesianEffectDto as BayesianEffectDto, inference_BayesianPredictRequest as BayesianPredictRequest, inference_BayesianPredictResponse as BayesianPredictResponse, inference_BindingDto as BindingDto, inference_BulkAddFactsRequest as BulkAddFactsRequest, inference_BulkAddFactsResponse as BulkAddFactsResponse, inference_BulkAddRulesRequest as BulkAddRulesRequest, inference_BulkAddRulesResponse as BulkAddRulesResponse, inference_BulkFuzzyProveRequest as BulkFuzzyProveRequest, inference_BulkFuzzyProveResponse as BulkFuzzyProveResponse, inference_ClearFactsResponse as ClearFactsResponse, inference_ConstraintInputDto as ConstraintInputDto, inference_CreateGoalRequest as CreateGoalRequest, inference_CreateGoalResponse as CreateGoalResponse, inference_DeleteGoalResponse as DeleteGoalResponse, inference_DraftRulesRequest as DraftRulesRequest, inference_DraftRulesResponse as DraftRulesResponse, inference_FactConfidenceEntry as FactConfidenceEntry, inference_ForwardChainRequest as ForwardChainRequest, inference_ForwardChainResponse as ForwardChainResponse, inference_FuzzyProveRequest as FuzzyProveRequest, inference_FuzzyProveResponse as FuzzyProveResponse, inference_GetFactsResponse as GetFactsResponse, inference_GetRulesResponse as GetRulesResponse, inference_GoalDto as GoalDto, inference_GoalSummaryDto as GoalSummaryDto, inference_GuardOp as GuardOp, inference_HomoiconicSubstitutionDto as HomoiconicSubstitutionDto, inference_ListGoalsResponse as ListGoalsResponse, inference_LiteralInputDto as LiteralInputDto, inference_MetaSortsResponse as MetaSortsResponse, inference_NafProveRequest as NafProveRequest, inference_NafProveResponse as NafProveResponse, inference_ProofDto as ProofDto, inference_ProvenanceTagDto as ProvenanceTagDto, inference_ReplaceRuleResponse as ReplaceRuleResponse, inference_RuleAggregatorDto as RuleAggregatorDto, inference_RuleCertificationDelta as RuleCertificationDelta, inference_RuleDerivationsDisposition as RuleDerivationsDisposition, inference_RuleDraftClarificationQuestionDto as RuleDraftClarificationQuestionDto, inference_RuleDraftDto as RuleDraftDto, inference_RuleEntryDto as RuleEntryDto, inference_RuleNotWithdrawable as RuleNotWithdrawable, inference_RuleOrigin as RuleOrigin, inference_RuleTermDraftDto as RuleTermDraftDto, inference_RuleWithdrawalReport as RuleWithdrawalReport, inference_SolutionDto as SolutionDto, inference_TaggedDerivedFact as TaggedDerivedFact, inference_TaggedForwardChainRequest as TaggedForwardChainRequest, inference_TaggedForwardChainResponse as TaggedForwardChainResponse };
35807
36134
  }
35808
36135
 
35809
36136
  /**
@@ -51132,12 +51459,25 @@ interface StructuredIngestionStatsDto {
51132
51459
  entitiesCreated: number;
51133
51460
  /** Number of entities extracted (from pipeline). */
51134
51461
  entitiesExtracted: number;
51462
+ /**
51463
+ * Number of records the source reported as available for the ingested
51464
+ * tables, before any cap or collapse. Compared with `recordsProcessed` a cap
51465
+ * hit is visible; compared with `termsCreated`, a partial ingest is.
51466
+ */
51467
+ recordsAvailable: number;
51135
51468
  /** Number of source records processed. */
51136
51469
  recordsProcessed: number;
51137
51470
  /** Number of relations created. */
51138
51471
  relationsCreated: number;
51139
51472
  /** Number of relations discovered. */
51140
51473
  relationsDiscovered: number;
51474
+ /**
51475
+ * Number of rows that collapsed onto a key value another row already
51476
+ * produced in the same run — the bound-key upsert merged them into one term.
51477
+ * Zero when the bound key identifies rows uniquely; named in `warnings` when
51478
+ * it is not.
51479
+ */
51480
+ rowsCollapsed: number;
51141
51481
  /** Number of sorts created (from pipeline). */
51142
51482
  sortsCreated: number;
51143
51483
  /** Number of types/tables discovered. */
@@ -56015,6 +56355,19 @@ declare class PreferencesClient {
56015
56355
  declare class Functions<SecurityDataType = unknown> {
56016
56356
  http: HttpClient<SecurityDataType>;
56017
56357
  constructor(http: HttpClient<SecurityDataType>);
56358
+ /**
56359
+ * @description # The disposition is the caller's `?callers=refuse` (the default) refuses while anything calls the function and names every caller; `?callers=orphan` withdraws it anyway and reports the callers left naming something that no longer resolves. A withdrawal that silently orphans its callers is the state the missing route already produced. # Authorization Requires `X-Tenant-Id`. The function store is tenant-keyed, so another tenant's function is `404` rather than forbidden. Every request is captured by the audit middleware.
56360
+ *
56361
+ * @tags functions
56362
+ * @name DeleteFunction
56363
+ * @summary Withdraw a registered function.
56364
+ * @request DELETE:/api/v1/functions/{name}
56365
+ * @secure
56366
+ */
56367
+ deleteFunction: (name: string, query?: {
56368
+ /** What to do about the things that call this function. */
56369
+ callers?: FunctionCallersDisposition$1;
56370
+ }, params?: RequestParams) => Promise<HttpResponse<FunctionWithdrawalReport$1, void>>;
56018
56371
  /**
56019
56372
  * @description Never writes to the KB — returns a validated draft for human review.
56020
56373
  *
@@ -56055,6 +56408,16 @@ declare class Functions<SecurityDataType = unknown> {
56055
56408
  * @secure
56056
56409
  */
56057
56410
  registerFunction: (data: RegisterFunctionRequest$1, params?: RequestParams) => Promise<HttpResponse<RegisterFunctionResponse$1, void>>;
56411
+ /**
56412
+ * @description # Why this is not `POST /functions/register` Registration already replaces by name — silently, reporting nothing about what it displaced. `PUT` is the operation that says so: it refuses when nothing is registered under the name (that is registration's job), and answers with the previous signature, the new one, whether the arity moved, and everything that calls the function. # The arity is the hazard A function's identity is its NAME, so a replacement keeps every caller's reference valid — nothing dangles. That is exactly why an arity change is dangerous rather than merely breaking: every call still resolves, and one passing the old number of arguments starts failing at evaluation time. Reported, not refused: the caller may be replacing the function precisely because its signature was wrong. # Authorization Identical to `DELETE`: tenant-keyed, plugin-owned functions refused, audited.
56413
+ *
56414
+ * @tags functions
56415
+ * @name ReplaceFunction
56416
+ * @summary Replace a registered function's definition.
56417
+ * @request PUT:/api/v1/functions/{name}
56418
+ * @secure
56419
+ */
56420
+ replaceFunction: (name: string, data: ReplaceFunctionRequest, params?: RequestParams) => Promise<HttpResponse<ReplaceFunctionResponse$1, void>>;
56058
56421
  }
56059
56422
 
56060
56423
  /**
@@ -56396,6 +56759,94 @@ type DraftFunctionResponse = {
56396
56759
  /** Non-fatal issues the user should see (e.g., unknown function references). */
56397
56760
  warnings: string[];
56398
56761
  };
56762
+ /** What a withdrawal does about the things that CALL the function. */
56763
+ type FunctionCallersDisposition = 'refuse' | 'orphan';
56764
+ /** Where a reference to a function lives. */
56765
+ type FunctionCallerKind = 'function' | 'rule';
56766
+ /**
56767
+ * One thing that calls a function.
56768
+ *
56769
+ * @remarks
56770
+ * A function is reachable by name from exactly two places: another registered
56771
+ * function's clause body, and a rule's `function_call` goal. Both are scanned
56772
+ * before a withdrawal, because removing the function underneath either leaves
56773
+ * the caller naming something that no longer resolves — and the failure
56774
+ * surfaces at evaluation time.
56775
+ */
56776
+ interface FunctionCaller {
56777
+ /** Where the reference lives. */
56778
+ kind: FunctionCallerKind;
56779
+ /**
56780
+ * The calling function's name, or a label for the calling rule — so a
56781
+ * refusal names something the caller can find.
56782
+ */
56783
+ name: string;
56784
+ /**
56785
+ * Term id of the calling rule's conclusion, or of the `function_call` goal
56786
+ * when no rule holds it. Absent for a function caller, which is identified
56787
+ * by name.
56788
+ */
56789
+ termId?: string;
56790
+ }
56791
+ /**
56792
+ * What withdrawing a registered function removed.
56793
+ *
56794
+ * @remarks
56795
+ * A function is carried TWICE — the durable `meta.function` carrier Ψ-term
56796
+ * that is the source of truth, and the evaluator's own registry used for
56797
+ * dispatch — so both are reported. Forgetting either leaves it half-alive:
56798
+ * still evaluable, or back after a restart.
56799
+ */
56800
+ interface FunctionWithdrawalReport {
56801
+ /** The function that was withdrawn. */
56802
+ name: string;
56803
+ /** Its stable id, as the registration reported it. */
56804
+ functionId: string;
56805
+ /**
56806
+ * Whether the durable carrier was deleted. `false` means the function is
56807
+ * gone from this process but its carrier survives, so a restart would bring
56808
+ * it back — the cue to retry.
56809
+ */
56810
+ carrierDeleted: boolean;
56811
+ /** Whether it left the in-process registry and the evaluator. */
56812
+ deregistered: boolean;
56813
+ /**
56814
+ * Everything still naming the function, left calling what no longer
56815
+ * resolves. Empty on the ordinary withdrawal; non-empty only under
56816
+ * `callers: 'orphan'`.
56817
+ */
56818
+ callersOrphaned: FunctionCaller[];
56819
+ }
56820
+ /** Result of replacing a registered function's definition. */
56821
+ interface ReplaceFunctionResponse {
56822
+ /** The function's name — unchanged by the replacement, by construction. */
56823
+ name: string;
56824
+ /**
56825
+ * The replacement's id. A fresh registration mints a new one, so it differs
56826
+ * from the previous definition's.
56827
+ */
56828
+ functionId: string;
56829
+ /** What the replaced definition looked like. */
56830
+ previous: FunctionSummaryDto;
56831
+ /** What the replacement looks like. */
56832
+ current: FunctionSummaryDto;
56833
+ /**
56834
+ * `true` when the arity changed.
56835
+ *
56836
+ * @remarks
56837
+ * A function's identity is its NAME, so a replacement keeps every caller's
56838
+ * reference valid — nothing dangles. That is exactly what makes an arity
56839
+ * change dangerous rather than merely breaking: every call still resolves,
56840
+ * and one passing the old argument count starts failing at evaluation time.
56841
+ */
56842
+ arityChanged: boolean;
56843
+ /**
56844
+ * Everything that calls this function. Reported rather than refused: the
56845
+ * replacement keeps the name resolvable, so no caller is orphaned — but one
56846
+ * written against the old signature may no longer be correct.
56847
+ */
56848
+ callers: FunctionCaller[];
56849
+ }
56399
56850
 
56400
56851
  type functions_AuthoringClarificationQuestionDto = AuthoringClarificationQuestionDto;
56401
56852
  type functions_BinaryOperatorDto = BinaryOperatorDto;
@@ -56405,18 +56856,23 @@ type functions_EvaluateFunctionRequest = EvaluateFunctionRequest;
56405
56856
  type functions_EvaluateFunctionResponse = EvaluateFunctionResponse;
56406
56857
  type functions_ExpressionDto = ExpressionDto;
56407
56858
  type functions_FunctionBodyDto = FunctionBodyDto;
56859
+ type functions_FunctionCaller = FunctionCaller;
56860
+ type functions_FunctionCallerKind = FunctionCallerKind;
56861
+ type functions_FunctionCallersDisposition = FunctionCallersDisposition;
56408
56862
  type functions_FunctionClauseDto = FunctionClauseDto;
56409
56863
  type functions_FunctionDraftDto = FunctionDraftDto;
56410
56864
  type functions_FunctionGuardDto = FunctionGuardDto;
56411
56865
  type functions_FunctionKindDto = FunctionKindDto;
56412
56866
  type functions_FunctionSummaryDto = FunctionSummaryDto;
56413
56867
  type functions_FunctionValueDto = FunctionValueDto;
56868
+ type functions_FunctionWithdrawalReport = FunctionWithdrawalReport;
56414
56869
  type functions_ListFunctionsResponse = ListFunctionsResponse;
56415
56870
  type functions_PatternDto = PatternDto;
56416
56871
  type functions_RegisterFunctionRequest = RegisterFunctionRequest;
56417
56872
  type functions_RegisterFunctionResponse = RegisterFunctionResponse;
56873
+ type functions_ReplaceFunctionResponse = ReplaceFunctionResponse;
56418
56874
  declare namespace functions {
56419
- export type { functions_AuthoringClarificationQuestionDto as AuthoringClarificationQuestionDto, functions_BinaryOperatorDto as BinaryOperatorDto, functions_DraftFunctionRequest as DraftFunctionRequest, functions_DraftFunctionResponse as DraftFunctionResponse, functions_EvaluateFunctionRequest as EvaluateFunctionRequest, functions_EvaluateFunctionResponse as EvaluateFunctionResponse, functions_ExpressionDto as ExpressionDto, functions_FunctionBodyDto as FunctionBodyDto, functions_FunctionClauseDto as FunctionClauseDto, functions_FunctionDraftDto as FunctionDraftDto, functions_FunctionGuardDto as FunctionGuardDto, functions_FunctionKindDto as FunctionKindDto, functions_FunctionSummaryDto as FunctionSummaryDto, functions_FunctionValueDto as FunctionValueDto, functions_ListFunctionsResponse as ListFunctionsResponse, functions_PatternDto as PatternDto, functions_RegisterFunctionRequest as RegisterFunctionRequest, functions_RegisterFunctionResponse as RegisterFunctionResponse };
56875
+ export type { functions_AuthoringClarificationQuestionDto as AuthoringClarificationQuestionDto, functions_BinaryOperatorDto as BinaryOperatorDto, functions_DraftFunctionRequest as DraftFunctionRequest, functions_DraftFunctionResponse as DraftFunctionResponse, functions_EvaluateFunctionRequest as EvaluateFunctionRequest, functions_EvaluateFunctionResponse as EvaluateFunctionResponse, functions_ExpressionDto as ExpressionDto, functions_FunctionBodyDto as FunctionBodyDto, functions_FunctionCaller as FunctionCaller, functions_FunctionCallerKind as FunctionCallerKind, functions_FunctionCallersDisposition as FunctionCallersDisposition, functions_FunctionClauseDto as FunctionClauseDto, functions_FunctionDraftDto as FunctionDraftDto, functions_FunctionGuardDto as FunctionGuardDto, functions_FunctionKindDto as FunctionKindDto, functions_FunctionSummaryDto as FunctionSummaryDto, functions_FunctionValueDto as FunctionValueDto, functions_FunctionWithdrawalReport as FunctionWithdrawalReport, functions_ListFunctionsResponse as ListFunctionsResponse, functions_PatternDto as PatternDto, functions_RegisterFunctionRequest as RegisterFunctionRequest, functions_RegisterFunctionResponse as RegisterFunctionResponse, functions_ReplaceFunctionResponse as ReplaceFunctionResponse };
56420
56876
  }
56421
56877
 
56422
56878
  /**
@@ -56563,6 +57019,78 @@ declare class FunctionsClient {
56563
57019
  * ```
56564
57020
  */
56565
57021
  listFunctions(): Promise<ListFunctionsResponse>;
57022
+ /**
57023
+ * Withdraw a registered function.
57024
+ *
57025
+ * @param name - The registered function's name — its identity.
57026
+ * @param options - `callers` decides what happens to the things that call
57027
+ * it. Defaults to `'refuse'`.
57028
+ * @returns What the withdrawal removed, in each representation that held it.
57029
+ * @throws {ApiError} 400 if something still calls the function under the
57030
+ * default `'refuse'` (the body carries `code: 'function_has_callers'` and
57031
+ * the caller list); 403 for a plugin-contributed function; 404 if nothing
57032
+ * is registered under that name.
57033
+ *
57034
+ * @remarks
57035
+ * A function is carried twice — the durable `meta.function` carrier that is
57036
+ * the source of truth, and the evaluator's own registry used for dispatch
57037
+ * and recursive cross-calls — and the report names both, because forgetting
57038
+ * either leaves it half-alive: still evaluable, or back after a restart.
57039
+ *
57040
+ * `'refuse'` names every caller; `'orphan'` withdraws anyway and reports the
57041
+ * callers left naming something that no longer resolves.
57042
+ *
57043
+ * @example
57044
+ * ```typescript
57045
+ * const report = await client.functions.deleteFunction('scale', { callers: 'orphan' });
57046
+ * for (const orphan of report.callersOrphaned) {
57047
+ * console.warn(`${orphan.kind} ${orphan.name} now calls a function that is gone`);
57048
+ * }
57049
+ * ```
57050
+ */
57051
+ deleteFunction(name: string, options?: {
57052
+ callers?: FunctionCallersDisposition;
57053
+ }): Promise<FunctionWithdrawalReport>;
57054
+ /**
57055
+ * Replace a registered function's definition.
57056
+ *
57057
+ * @param name - The registered function's name. Unchanged by the
57058
+ * replacement — the name IS the identity.
57059
+ * @param request - The replacement's arity and clauses.
57060
+ * @returns Both signatures, whether the arity moved, and everything that
57061
+ * calls the function.
57062
+ * @throws {ApiError} 400 if the replacement's clauses are rejected — in
57063
+ * which case the registration is left exactly as it was; 403 for a
57064
+ * plugin-contributed function; 404 if nothing is registered under that
57065
+ * name (creating one is {@link FunctionsClient.registerFunction}'s job).
57066
+ *
57067
+ * @remarks
57068
+ * `registerFunction` already replaces by name — silently, reporting nothing
57069
+ * about what it displaced. This is the operation that says so.
57070
+ *
57071
+ * A function's identity is its NAME, so a replacement keeps every caller's
57072
+ * reference valid: nothing dangles. That is exactly why an arity change is
57073
+ * the dangerous edit — every call still resolves, and one passing the old
57074
+ * argument count starts failing at evaluation time. `arityChanged` is
57075
+ * reported rather than refused, because a caller may be replacing the
57076
+ * function precisely because its signature was wrong.
57077
+ *
57078
+ * @example
57079
+ * ```typescript
57080
+ * const result = await client.functions.replaceFunction('scale', {
57081
+ * arity: 2,
57082
+ * clauses: [multiplyClause],
57083
+ * });
57084
+ * if (result.arityChanged) {
57085
+ * console.warn(`arity ${result.previous.arity} -> ${result.current.arity};`,
57086
+ * `${result.callers.length} caller(s) were written against the old one`);
57087
+ * }
57088
+ * ```
57089
+ */
57090
+ replaceFunction(name: string, request: {
57091
+ arity: number;
57092
+ clauses: FunctionClauseDto[];
57093
+ }): Promise<ReplaceFunctionResponse>;
56566
57094
  /**
56567
57095
  * Draft a user-defined function from a natural-language description.
56568
57096
  *
@@ -58932,6 +59460,16 @@ interface ClearTenantResponse {
58932
59460
  inferenceStateCleared: boolean;
58933
59461
  /** Whether the cache was invalidated. */
58934
59462
  cacheInvalidated: boolean;
59463
+ /**
59464
+ * Number of vector-store points deleted for this tenant.
59465
+ *
59466
+ * @remarks
59467
+ * Reported separately because it is the one count an erasure request cannot
59468
+ * verify any other way: vector payloads carry the embedded text, so a wipe
59469
+ * that left them behind would report every table emptied while the tenant's
59470
+ * data stayed readable by similarity search.
59471
+ */
59472
+ vectorsDeleted: number;
58935
59473
  /**
58936
59474
  * Number of plugin-marketplace install records forgotten for this tenant.
58937
59475
  *
@@ -67215,11 +67753,49 @@ interface BulkBindSortsResponse {
67215
67753
  /**
67216
67754
  * Summary of a single active sort-table binding.
67217
67755
  */
67756
+ interface KeyProvenanceDto {
67757
+ /**
67758
+ * Which authority chose the key: `source_constraint`,
67759
+ * `synthetic_record_id`, `sequence_default`, `schema_declared_identifier`,
67760
+ * `naming_convention`, `sampled_uniqueness`, `client_supplied`, `keyless`
67761
+ * or `unrecorded`.
67762
+ */
67763
+ source: string;
67764
+ /**
67765
+ * Which side settled it: `discovery`, `client`, `nobody` (a keyless
67766
+ * binding), or `unrecorded`.
67767
+ */
67768
+ chosenBy: string;
67769
+ /** One sentence stating what this key source means, in plain words. */
67770
+ explanation: string;
67771
+ /**
67772
+ * Whether some authority guarantees the key identifies exactly one record.
67773
+ * Absent where the question has no answer — a keyless binding, or a
67774
+ * provenance that was never recorded.
67775
+ */
67776
+ guaranteedUnique?: boolean | null;
67777
+ /**
67778
+ * Whether term ids built from this key survive a rebuild of the source:
67779
+ * `survives_source_rebuild` or `lifetime_scoped`. Absent for a
67780
+ * client-supplied key, where nothing declares it.
67781
+ */
67782
+ durability?: string | null;
67783
+ }
67784
+ /**
67785
+ * One active sort↔table binding.
67786
+ */
67218
67787
  interface BindingSummaryDto {
67219
67788
  /** Number of bound features/columns. */
67220
67789
  featureCount: number;
67221
67790
  /** Primary key column names. */
67222
67791
  keyColumns: string[];
67792
+ /**
67793
+ * Where the key columns came from, and what that implies for the durability
67794
+ * of ids derived from them. The column names cannot say it: `["title"]`
67795
+ * looks identical whether a uniqueness constraint backs it or an operator
67796
+ * nominated it.
67797
+ */
67798
+ keyProvenance: KeyProvenanceDto;
67223
67799
  /** Sort ID (UUID string). */
67224
67800
  sortId: string;
67225
67801
  /** External source identifier. */
@@ -67351,11 +67927,12 @@ type ontologyBridge_ImportFoundryRequest = ImportFoundryRequest;
67351
67927
  type ontologyBridge_ImportFoundryResponse = ImportFoundryResponse;
67352
67928
  type ontologyBridge_ImportOwlRequest = ImportOwlRequest;
67353
67929
  type ontologyBridge_ImportOwlResponse = ImportOwlResponse;
67930
+ type ontologyBridge_KeyProvenanceDto = KeyProvenanceDto;
67354
67931
  type ontologyBridge_ListBindingsResponse = ListBindingsResponse;
67355
67932
  type ontologyBridge_TranspileRequest = TranspileRequest;
67356
67933
  type ontologyBridge_TranspileResponse = TranspileResponse;
67357
67934
  declare namespace ontologyBridge {
67358
- export type { ontologyBridge_BindSortRequest as BindSortRequest, ontologyBridge_BindSortResponse as BindSortResponse, ontologyBridge_BindingSummaryDto as BindingSummaryDto, ontologyBridge_BulkBindError as BulkBindError, ontologyBridge_BulkBindSortsRequest as BulkBindSortsRequest, ontologyBridge_BulkBindSortsResponse as BulkBindSortsResponse, ontologyBridge_ColumnMappingDto as ColumnMappingDto, ontologyBridge_FoundryReviewItemDto as FoundryReviewItemDto, ontologyBridge_GroundedSchemaResponse as GroundedSchemaResponse, ontologyBridge_ImportFoundryRequest as ImportFoundryRequest, ontologyBridge_ImportFoundryResponse as ImportFoundryResponse, ontologyBridge_ImportOwlRequest as ImportOwlRequest, ontologyBridge_ImportOwlResponse as ImportOwlResponse, ontologyBridge_ListBindingsResponse as ListBindingsResponse, ontologyBridge_TranspileRequest as TranspileRequest, ontologyBridge_TranspileResponse as TranspileResponse };
67935
+ export type { ontologyBridge_BindSortRequest as BindSortRequest, ontologyBridge_BindSortResponse as BindSortResponse, ontologyBridge_BindingSummaryDto as BindingSummaryDto, ontologyBridge_BulkBindError as BulkBindError, ontologyBridge_BulkBindSortsRequest as BulkBindSortsRequest, ontologyBridge_BulkBindSortsResponse as BulkBindSortsResponse, ontologyBridge_ColumnMappingDto as ColumnMappingDto, ontologyBridge_FoundryReviewItemDto as FoundryReviewItemDto, ontologyBridge_GroundedSchemaResponse as GroundedSchemaResponse, ontologyBridge_ImportFoundryRequest as ImportFoundryRequest, ontologyBridge_ImportFoundryResponse as ImportFoundryResponse, ontologyBridge_ImportOwlRequest as ImportOwlRequest, ontologyBridge_ImportOwlResponse as ImportOwlResponse, ontologyBridge_KeyProvenanceDto as KeyProvenanceDto, ontologyBridge_ListBindingsResponse as ListBindingsResponse, ontologyBridge_TranspileRequest as TranspileRequest, ontologyBridge_TranspileResponse as TranspileResponse };
67359
67936
  }
67360
67937
 
67361
67938
  /**