@kortexya/reasoninglayer 1.5.1 → 1.6.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.5.1";
112
+ declare const SDK_VERSION = "1.6.0";
113
113
  /**
114
114
  * Authentication mode for the SDK.
115
115
  *
@@ -3391,6 +3391,40 @@ interface ConfirmResponseDto {
3391
3391
  }
3392
3392
  /** How to resolve feature conflicts when merging */
3393
3393
  type ConflictResolution$1 = "keep_existing" | "use_new" | "merge";
3394
+ /**
3395
+ * A concrete order-dependence counterexample: two rules that derive conflicting
3396
+ * values for a feature declared functional.
3397
+ */
3398
+ interface ConfluenceConflictDto {
3399
+ /** The two conflicting values the rules derive for the same entity. */
3400
+ conflicting_values: string[];
3401
+ /** The functional feature the two rules disagree on. */
3402
+ feature: string;
3403
+ /** The kind of conflict (currently always `"functional-dependency-violation"`). */
3404
+ kind: string;
3405
+ }
3406
+ /** Confluence (order-independence) half of the certificate. */
3407
+ interface ConfluenceDto {
3408
+ /** The concrete counterexample, when the rule base is not order-independent. */
3409
+ conflict?: null | ConfluenceConflictDto;
3410
+ /**
3411
+ * `true` iff forward reasoning produces the same result regardless of the
3412
+ * order rules fire in.
3413
+ */
3414
+ order_independent: boolean;
3415
+ /**
3416
+ * Why: `"monotone-least-fixpoint"`, `"congruence-closure"`, `"monotone-chase"`,
3417
+ * `"vacuous"`, `"branching"` (disjunctive rules explore multiple models), or
3418
+ * `"functional-conflict"` (a counterexample was found).
3419
+ */
3420
+ reason: string;
3421
+ /**
3422
+ * Number of rule interactions found (places one rule's output can trigger
3423
+ * another). All are order-safe when `order_independent` is `true`.
3424
+ * @min 0
3425
+ */
3426
+ rule_interactions: number;
3427
+ }
3394
3428
  /** A single constraint check in the verification result. */
3395
3429
  interface ConstraintCheckDto$1 {
3396
3430
  /** Description of the constraint. */
@@ -9675,6 +9709,16 @@ interface IngestRdfRequest$1 {
9675
9709
  content: string;
9676
9710
  /** Format of the RDF content */
9677
9711
  format: RdfFormatDto$1;
9712
+ /**
9713
+ * Whether to materialise OWL/RDFS class & property *declarations*
9714
+ * (`:p a owl:DatatypeProperty`, `:C a owl:Class`) as queryable identity terms.
9715
+ *
9716
+ * Default `false` keeps declarations as schema (out of `?s ?p ?o`), the
9717
+ * established behaviour for ordinary ingest. Set `true` only for SPARQL OWL/RDFS
9718
+ * entailment workloads, where `?p a owl:DatatypeProperty` and `?c rdfs:subClassOf
9719
+ * ?d` must match declarations.
9720
+ */
9721
+ keep_declarations?: boolean;
9678
9722
  /** Whether to also parse OWL ontology from the content */
9679
9723
  parse_ontology?: boolean;
9680
9724
  /** Whether to also parse SHACL shapes from the content */
@@ -13007,6 +13051,14 @@ interface OsfqlRequest$1 {
13007
13051
  * ```
13008
13052
  */
13009
13053
  query: string;
13054
+ /**
13055
+ * Opt into **reactive (streaming) mode**: after the program runs, any
13056
+ * suspended `AWAIT` demon whose trigger is now satisfied fires
13057
+ * automatically — no explicit `RELEASE RESIDUATIONS` needed. Defaults to
13058
+ * `false` (demons stay suspended until an explicit RELEASE), so existing
13059
+ * clients are byte-identical.
13060
+ */
13061
+ reactive?: boolean;
13010
13062
  }
13011
13063
  /** Response from executing an OSFQL program. */
13012
13064
  interface OsfqlResponse$1 {
@@ -14022,7 +14074,7 @@ interface QueueMetricsResponse {
14022
14074
  worker_utilization_pct?: number | null;
14023
14075
  }
14024
14076
  /** RDF format DTO */
14025
- type RdfFormatDto$1 = "turtle" | "n_triples" | "rdf_xml" | "json_ld";
14077
+ type RdfFormatDto$1 = "turtle" | "n_triples" | "rdf_xml" | "json_ld" | "trig" | "nquads";
14026
14078
  /** Request to re-extract entities from a document */
14027
14079
  interface ReExtractRequest$1 {
14028
14080
  /** Document ID to re-extract from */
@@ -15446,6 +15498,18 @@ interface RuleAggregatorDto {
15446
15498
  /** Feature name whose value is aggregated within each group. */
15447
15499
  target: string;
15448
15500
  }
15501
+ /** The full certification result returned to the caller. */
15502
+ interface RuleBaseCertificateDto {
15503
+ /** The order-independence guarantee (or the conflicting rule pair). */
15504
+ confluence: ConfluenceDto;
15505
+ /**
15506
+ * `true` iff the rule base both terminates and is order-independent — the
15507
+ * complete "won't loop, order-independent" guarantee.
15508
+ */
15509
+ fully_certified: boolean;
15510
+ /** The termination guarantee (or why it could not be established). */
15511
+ termination: TerminationDto;
15512
+ }
15449
15513
  /** A rule clause (OSF clause) */
15450
15514
  interface RuleClauseDto$1 {
15451
15515
  /** Constraints on variables in this clause */
@@ -18033,6 +18097,36 @@ interface TermTranslationDto {
18033
18097
  copied_id: string;
18034
18098
  original_id: string;
18035
18099
  }
18100
+ /** Termination half of the certificate. */
18101
+ interface TerminationDto {
18102
+ /**
18103
+ * Whether any rule invents fresh values (creating new entities), present only
18104
+ * when established via the ranking function.
18105
+ */
18106
+ creates_new_values?: boolean | null;
18107
+ /**
18108
+ * When termination could not be established and an obstruction was found, the
18109
+ * human-readable cycle of interacting positions that can grow without bound.
18110
+ */
18111
+ diverging_cycle?: any[] | null;
18112
+ /**
18113
+ * The deepest chain of freshly-created values any reasoning step can produce
18114
+ * (the ranking-function bound). `0` means the rules never invent new values
18115
+ * — reasoning is bounded by the existing data. Present only when terminating
18116
+ * via the ranking function.
18117
+ * @format int32
18118
+ * @min 0
18119
+ */
18120
+ max_recursion_depth?: number | null;
18121
+ /**
18122
+ * How termination was established: `"bounded-recursion"` (a ranking function
18123
+ * bounds value creation), `"decidable-fragment:<name>"` (a recognised
18124
+ * terminating rule class), or `"undetermined"`.
18125
+ */
18126
+ method: string;
18127
+ /** `true` iff forward reasoning is guaranteed to reach a fixpoint. */
18128
+ terminates: boolean;
18129
+ }
18036
18130
  /** Threshold-based weak anchor for an antecedent gate. */
18037
18131
  interface ThresholdAnchorDto {
18038
18132
  /**
@@ -38381,6 +38475,15 @@ declare class Analysis<SecurityDataType = unknown> {
38381
38475
  * @request POST:/api/v1/analysis/sort-discovery
38382
38476
  */
38383
38477
  analyzeSortDiscovery: (data: SortDiscoveryRequestDto, params?: RequestParams) => Promise<HttpResponse<SortDiscoveryResponseDto, void>>;
38478
+ /**
38479
+ * @description Returns a [`RuleBaseCertificateDto`]: whether forward reasoning is guaranteed to halt (with the ranking-function depth bound), and whether it is order-independent (with the theorem discharged, or a concrete conflicting rule pair). The analysis is read-only over the tenant's knowledge base.
38480
+ *
38481
+ * @tags analysis
38482
+ * @name CertifyRuleBase
38483
+ * @summary Certify the authenticated tenant's rule base.
38484
+ * @request GET:/api/v1/analysis/rule-base/certify
38485
+ */
38486
+ certifyRuleBase: (params?: RequestParams) => Promise<HttpResponse<RuleBaseCertificateDto, any>>;
38384
38487
  /**
38385
38488
  * @description The exploration must be complete (no more questions) before calling this. Creates appropriateness sorts in the hierarchy from the Duquenne-Guigues basis.
38386
38489
  *
@@ -43566,6 +43669,17 @@ interface ConversationMessageResponse {
43566
43669
  intent: string;
43567
43670
  /** OSFQL that was executed (if any). */
43568
43671
  osfqlExecuted?: string | null;
43672
+ /**
43673
+ * True when {@link osfqlExecuted} is a constrained-regeneration *repair* of a query the
43674
+ * certify-or-abstain gate first rejected as hallucinated. Lets the UI surface that the answer
43675
+ * reflects a corrected query rather than the user's literal request.
43676
+ */
43677
+ repaired?: boolean;
43678
+ /**
43679
+ * The original, rejected OSFQL the LLM first proposed — present only when {@link repaired} is
43680
+ * true. Pairs with {@link osfqlExecuted} so the UI can show the `original → executed` diff.
43681
+ */
43682
+ originalOsfql?: string | null;
43569
43683
  /** Query results (if OSFQL was a MATCH). Each entry maps variable names to bound values. */
43570
43684
  queryResults?: Record<string, OsfqlValue>[] | null;
43571
43685
  /** IDs of terms produced by the OSFQL execution. */
package/dist/index.d.ts 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.5.1";
112
+ declare const SDK_VERSION = "1.6.0";
113
113
  /**
114
114
  * Authentication mode for the SDK.
115
115
  *
@@ -3391,6 +3391,40 @@ interface ConfirmResponseDto {
3391
3391
  }
3392
3392
  /** How to resolve feature conflicts when merging */
3393
3393
  type ConflictResolution$1 = "keep_existing" | "use_new" | "merge";
3394
+ /**
3395
+ * A concrete order-dependence counterexample: two rules that derive conflicting
3396
+ * values for a feature declared functional.
3397
+ */
3398
+ interface ConfluenceConflictDto {
3399
+ /** The two conflicting values the rules derive for the same entity. */
3400
+ conflicting_values: string[];
3401
+ /** The functional feature the two rules disagree on. */
3402
+ feature: string;
3403
+ /** The kind of conflict (currently always `"functional-dependency-violation"`). */
3404
+ kind: string;
3405
+ }
3406
+ /** Confluence (order-independence) half of the certificate. */
3407
+ interface ConfluenceDto {
3408
+ /** The concrete counterexample, when the rule base is not order-independent. */
3409
+ conflict?: null | ConfluenceConflictDto;
3410
+ /**
3411
+ * `true` iff forward reasoning produces the same result regardless of the
3412
+ * order rules fire in.
3413
+ */
3414
+ order_independent: boolean;
3415
+ /**
3416
+ * Why: `"monotone-least-fixpoint"`, `"congruence-closure"`, `"monotone-chase"`,
3417
+ * `"vacuous"`, `"branching"` (disjunctive rules explore multiple models), or
3418
+ * `"functional-conflict"` (a counterexample was found).
3419
+ */
3420
+ reason: string;
3421
+ /**
3422
+ * Number of rule interactions found (places one rule's output can trigger
3423
+ * another). All are order-safe when `order_independent` is `true`.
3424
+ * @min 0
3425
+ */
3426
+ rule_interactions: number;
3427
+ }
3394
3428
  /** A single constraint check in the verification result. */
3395
3429
  interface ConstraintCheckDto$1 {
3396
3430
  /** Description of the constraint. */
@@ -9675,6 +9709,16 @@ interface IngestRdfRequest$1 {
9675
9709
  content: string;
9676
9710
  /** Format of the RDF content */
9677
9711
  format: RdfFormatDto$1;
9712
+ /**
9713
+ * Whether to materialise OWL/RDFS class & property *declarations*
9714
+ * (`:p a owl:DatatypeProperty`, `:C a owl:Class`) as queryable identity terms.
9715
+ *
9716
+ * Default `false` keeps declarations as schema (out of `?s ?p ?o`), the
9717
+ * established behaviour for ordinary ingest. Set `true` only for SPARQL OWL/RDFS
9718
+ * entailment workloads, where `?p a owl:DatatypeProperty` and `?c rdfs:subClassOf
9719
+ * ?d` must match declarations.
9720
+ */
9721
+ keep_declarations?: boolean;
9678
9722
  /** Whether to also parse OWL ontology from the content */
9679
9723
  parse_ontology?: boolean;
9680
9724
  /** Whether to also parse SHACL shapes from the content */
@@ -13007,6 +13051,14 @@ interface OsfqlRequest$1 {
13007
13051
  * ```
13008
13052
  */
13009
13053
  query: string;
13054
+ /**
13055
+ * Opt into **reactive (streaming) mode**: after the program runs, any
13056
+ * suspended `AWAIT` demon whose trigger is now satisfied fires
13057
+ * automatically — no explicit `RELEASE RESIDUATIONS` needed. Defaults to
13058
+ * `false` (demons stay suspended until an explicit RELEASE), so existing
13059
+ * clients are byte-identical.
13060
+ */
13061
+ reactive?: boolean;
13010
13062
  }
13011
13063
  /** Response from executing an OSFQL program. */
13012
13064
  interface OsfqlResponse$1 {
@@ -14022,7 +14074,7 @@ interface QueueMetricsResponse {
14022
14074
  worker_utilization_pct?: number | null;
14023
14075
  }
14024
14076
  /** RDF format DTO */
14025
- type RdfFormatDto$1 = "turtle" | "n_triples" | "rdf_xml" | "json_ld";
14077
+ type RdfFormatDto$1 = "turtle" | "n_triples" | "rdf_xml" | "json_ld" | "trig" | "nquads";
14026
14078
  /** Request to re-extract entities from a document */
14027
14079
  interface ReExtractRequest$1 {
14028
14080
  /** Document ID to re-extract from */
@@ -15446,6 +15498,18 @@ interface RuleAggregatorDto {
15446
15498
  /** Feature name whose value is aggregated within each group. */
15447
15499
  target: string;
15448
15500
  }
15501
+ /** The full certification result returned to the caller. */
15502
+ interface RuleBaseCertificateDto {
15503
+ /** The order-independence guarantee (or the conflicting rule pair). */
15504
+ confluence: ConfluenceDto;
15505
+ /**
15506
+ * `true` iff the rule base both terminates and is order-independent — the
15507
+ * complete "won't loop, order-independent" guarantee.
15508
+ */
15509
+ fully_certified: boolean;
15510
+ /** The termination guarantee (or why it could not be established). */
15511
+ termination: TerminationDto;
15512
+ }
15449
15513
  /** A rule clause (OSF clause) */
15450
15514
  interface RuleClauseDto$1 {
15451
15515
  /** Constraints on variables in this clause */
@@ -18033,6 +18097,36 @@ interface TermTranslationDto {
18033
18097
  copied_id: string;
18034
18098
  original_id: string;
18035
18099
  }
18100
+ /** Termination half of the certificate. */
18101
+ interface TerminationDto {
18102
+ /**
18103
+ * Whether any rule invents fresh values (creating new entities), present only
18104
+ * when established via the ranking function.
18105
+ */
18106
+ creates_new_values?: boolean | null;
18107
+ /**
18108
+ * When termination could not be established and an obstruction was found, the
18109
+ * human-readable cycle of interacting positions that can grow without bound.
18110
+ */
18111
+ diverging_cycle?: any[] | null;
18112
+ /**
18113
+ * The deepest chain of freshly-created values any reasoning step can produce
18114
+ * (the ranking-function bound). `0` means the rules never invent new values
18115
+ * — reasoning is bounded by the existing data. Present only when terminating
18116
+ * via the ranking function.
18117
+ * @format int32
18118
+ * @min 0
18119
+ */
18120
+ max_recursion_depth?: number | null;
18121
+ /**
18122
+ * How termination was established: `"bounded-recursion"` (a ranking function
18123
+ * bounds value creation), `"decidable-fragment:<name>"` (a recognised
18124
+ * terminating rule class), or `"undetermined"`.
18125
+ */
18126
+ method: string;
18127
+ /** `true` iff forward reasoning is guaranteed to reach a fixpoint. */
18128
+ terminates: boolean;
18129
+ }
18036
18130
  /** Threshold-based weak anchor for an antecedent gate. */
18037
18131
  interface ThresholdAnchorDto {
18038
18132
  /**
@@ -38381,6 +38475,15 @@ declare class Analysis<SecurityDataType = unknown> {
38381
38475
  * @request POST:/api/v1/analysis/sort-discovery
38382
38476
  */
38383
38477
  analyzeSortDiscovery: (data: SortDiscoveryRequestDto, params?: RequestParams) => Promise<HttpResponse<SortDiscoveryResponseDto, void>>;
38478
+ /**
38479
+ * @description Returns a [`RuleBaseCertificateDto`]: whether forward reasoning is guaranteed to halt (with the ranking-function depth bound), and whether it is order-independent (with the theorem discharged, or a concrete conflicting rule pair). The analysis is read-only over the tenant's knowledge base.
38480
+ *
38481
+ * @tags analysis
38482
+ * @name CertifyRuleBase
38483
+ * @summary Certify the authenticated tenant's rule base.
38484
+ * @request GET:/api/v1/analysis/rule-base/certify
38485
+ */
38486
+ certifyRuleBase: (params?: RequestParams) => Promise<HttpResponse<RuleBaseCertificateDto, any>>;
38384
38487
  /**
38385
38488
  * @description The exploration must be complete (no more questions) before calling this. Creates appropriateness sorts in the hierarchy from the Duquenne-Guigues basis.
38386
38489
  *
@@ -43566,6 +43669,17 @@ interface ConversationMessageResponse {
43566
43669
  intent: string;
43567
43670
  /** OSFQL that was executed (if any). */
43568
43671
  osfqlExecuted?: string | null;
43672
+ /**
43673
+ * True when {@link osfqlExecuted} is a constrained-regeneration *repair* of a query the
43674
+ * certify-or-abstain gate first rejected as hallucinated. Lets the UI surface that the answer
43675
+ * reflects a corrected query rather than the user's literal request.
43676
+ */
43677
+ repaired?: boolean;
43678
+ /**
43679
+ * The original, rejected OSFQL the LLM first proposed — present only when {@link repaired} is
43680
+ * true. Pairs with {@link osfqlExecuted} so the UI can show the `original → executed` diff.
43681
+ */
43682
+ originalOsfql?: string | null;
43569
43683
  /** Query results (if OSFQL was a MATCH). Each entry maps variable names to bound values. */
43570
43684
  queryResults?: Record<string, OsfqlValue>[] | null;
43571
43685
  /** IDs of terms produced by the OSFQL execution. */
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/config.ts
8
- var SDK_VERSION = "1.5.1";
8
+ var SDK_VERSION = "1.6.0";
9
9
  function resolveConfig(config) {
10
10
  if (!config.baseUrl) {
11
11
  throw new Error("ClientConfig.baseUrl is required");
@@ -6967,6 +6967,20 @@ var Analysis = class {
6967
6967
  format: "json",
6968
6968
  ...params
6969
6969
  });
6970
+ /**
6971
+ * @description Returns a [`RuleBaseCertificateDto`]: whether forward reasoning is guaranteed to halt (with the ranking-function depth bound), and whether it is order-independent (with the theorem discharged, or a concrete conflicting rule pair). The analysis is read-only over the tenant's knowledge base.
6972
+ *
6973
+ * @tags analysis
6974
+ * @name CertifyRuleBase
6975
+ * @summary Certify the authenticated tenant's rule base.
6976
+ * @request GET:/api/v1/analysis/rule-base/certify
6977
+ */
6978
+ certifyRuleBase = (params = {}) => this.http.request({
6979
+ path: `/api/v1/analysis/rule-base/certify`,
6980
+ method: "GET",
6981
+ format: "json",
6982
+ ...params
6983
+ });
6970
6984
  /**
6971
6985
  * @description The exploration must be complete (no more questions) before calling this. Creates appropriateness sorts in the hierarchy from the Duquenne-Guigues basis.
6972
6986
  *
@@ -22353,6 +22367,8 @@ function ConversationMessageResponseFromApiToFront(dto) {
22353
22367
  conversationId: dto.conversation_id,
22354
22368
  intent: dto.intent,
22355
22369
  osfqlExecuted: dto.osfql_executed ?? void 0,
22370
+ repaired: dto.repaired ?? false,
22371
+ originalOsfql: dto.original_osfql ?? void 0,
22356
22372
  queryResults: dto.query_results ?? void 0,
22357
22373
  producedTermIds: dto.produced_term_ids,
22358
22374
  uiSortId: dto.ui_sort_id ?? void 0,