@kortexya/reasoninglayer 0.15.1 → 0.16.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 = "0.15.1";
112
+ declare const SDK_VERSION = "0.16.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -3898,6 +3898,28 @@ interface DetectMissingAttributesRequest$1 {
3898
3898
  call_attributes: string[];
3899
3899
  definition_attributes: string[];
3900
3900
  }
3901
+ /** Request to validate a Difference-in-Differences design */
3902
+ interface DiDValidationRequest {
3903
+ /** Conditioning set (covariates) */
3904
+ covariates?: string[];
3905
+ /** Post-treatment outcome variable */
3906
+ outcome_post: string;
3907
+ /** Pre-treatment outcome variable */
3908
+ outcome_pre: string;
3909
+ /** The treatment variable */
3910
+ treatment: string;
3911
+ }
3912
+ /** Response for DiD validation */
3913
+ interface DiDValidationResponse {
3914
+ /** Identified "bad controls" (nodes that induce bias if conditioned on) */
3915
+ bad_controls: string[];
3916
+ /** Explanation of the result */
3917
+ explanation: string;
3918
+ /** The framework used for validation */
3919
+ framework: string;
3920
+ /** Whether the design is valid */
3921
+ is_valid: boolean;
3922
+ }
3901
3923
  /** A pipeline diagnostic message. */
3902
3924
  interface DiagnosticDto$1 {
3903
3925
  /** Severity level: "info", "warning", or "error". */
@@ -6086,6 +6108,8 @@ type FeatureConstraintDto = {
6086
6108
  };
6087
6109
  /** API representation of a feature descriptor */
6088
6110
  interface FeatureDescriptorDto$1 {
6111
+ /** Custom OWL annotations for this feature (e.g., isIdentifier, unit, enumValues) */
6112
+ annotations?: Record<string, string>;
6089
6113
  /** Optional constraint on the feature value */
6090
6114
  constraint?: null | ConstraintDto$1;
6091
6115
  /**
@@ -6385,12 +6409,6 @@ interface FormalJudgeRequest$1 {
6385
6409
  * Paper Table 5: `trajectory.tool_calls`
6386
6410
  */
6387
6411
  trajectory: TrajectoryStepDto$1[];
6388
- /**
6389
- * Use the OSFKB-native safety engine instead of the LLM-based adapter.
6390
- * When true, uses sort hierarchy + neural sort grounding + homoiconic rules.
6391
- * When false (default), uses the LLM-based OversightExtractionAdapter.
6392
- */
6393
- use_osfkb_engine?: boolean;
6394
6412
  /** User instruction (what the agent was asked to do) */
6395
6413
  user_intent: string;
6396
6414
  }
@@ -14199,6 +14217,8 @@ interface SortDiscoveryResponseDto {
14199
14217
  }
14200
14218
  /** API representation of a sort with full OSF schema */
14201
14219
  interface SortDto$1 {
14220
+ /** Custom OWL annotations (e.g., icon, color) */
14221
+ annotations?: Record<string, string>;
14202
14222
  /** Bound constraints on feature values */
14203
14223
  bound_constraints?: BoundConstraintDto$1[];
14204
14224
  /** Human-readable description for semantic search */
@@ -14430,6 +14450,16 @@ type SpaceConstraintDto$1 = {
14430
14450
  total: number;
14431
14451
  type: "sum_equal";
14432
14452
  variables: string[];
14453
+ } | {
14454
+ a: string[];
14455
+ b: string[];
14456
+ type: "lex_leq";
14457
+ } | {
14458
+ groups: string[][];
14459
+ type: "symmetry_group";
14460
+ } | {
14461
+ entities: string[][];
14462
+ type: "symmetric_observation";
14433
14463
  } | {
14434
14464
  lower: number[];
14435
14465
  type: "set_domain";
@@ -16164,20 +16194,35 @@ type ValuePatternDto$1 = {
16164
16194
  /**
16165
16195
  * Feasibility of a single binary variable in the constraint space.
16166
16196
  *
16167
- * Produced by `feasibility` mode search. Both fields can be `false` only
16168
- * when the problem is UNSAT (no valid assignment exists).
16197
+ * Produced by `feasibility` mode search. Fields report **observation-based**
16198
+ * reachability: the solver sets `can_be_true` only when it has witnessed a
16199
+ * complete satisfying assignment with this variable = 1 (and similarly for
16200
+ * `can_be_false`). Both fields can be `false` only when the problem is UNSAT.
16169
16201
  */
16170
16202
  interface VariableFeasibilityDto$1 {
16171
16203
  /**
16172
- * `true` if there exists at least one valid assignment where this variable
16204
+ * `true` if the solver witnessed a valid assignment where this variable
16173
16205
  * is 0 (unselected / false).
16174
16206
  */
16175
16207
  can_be_false: boolean;
16176
16208
  /**
16177
- * `true` if there exists at least one valid assignment where this variable
16209
+ * `true` if the solver witnessed a valid assignment where this variable
16178
16210
  * is 1 (selected / true).
16179
16211
  */
16180
16212
  can_be_true: boolean;
16213
+ /**
16214
+ * `true` when the result is fully determined by the solver — both
16215
+ * polarities were either observed in a model or formally proven
16216
+ * infeasible (by unit propagation or an UNSAT probe).
16217
+ *
16218
+ * `false` when a conflict limit was hit before the solver could fully
16219
+ * determine the variable's status. In that case `can_be_true` /
16220
+ * `can_be_false` still faithfully reflect the polarities the solver
16221
+ * actually witnessed — they are **never** optimistic defaults. Clients
16222
+ * typically render unverified variables in an intermediate visual state
16223
+ * (e.g. yellow/amber) so the user knows the result is approximate.
16224
+ */
16225
+ verified?: boolean;
16181
16226
  }
16182
16227
  /** Result of verbalizing a single PsiTerm. */
16183
16228
  interface VerbalizationResultDto$1 {
@@ -25921,6 +25966,16 @@ declare class Causal<SecurityDataType = unknown> {
25921
25966
  * @secure
25922
25967
  */
25923
25968
  getCausalModel: (params?: RequestParams) => Promise<HttpResponse<GetCausalModelResponse$1, any>>;
25969
+ /**
25970
+ * @description This endpoint validates whether a DiD design is theoretically sound given the known causal structure and unobserved confounding. It uses the Transformed SWIG (Delta-SWIG) framework from Knaus & Pfleiderer (2026).
25971
+ *
25972
+ * @tags causal
25973
+ * @name ValidateDid
25974
+ * @summary Validate a Difference-in-Differences (DiD) design
25975
+ * @request POST:/api/v1/causal/validate-did
25976
+ * @secure
25977
+ */
25978
+ validateDid: (data: DiDValidationRequest, params?: RequestParams) => Promise<HttpResponse<DiDValidationResponse, void>>;
25924
25979
  }
25925
25980
 
25926
25981
  /**
@@ -30876,14 +30931,31 @@ type SearchModeDto = 'solutions' | 'feasibility';
30876
30931
  *
30877
30932
  * @remarks
30878
30933
  * Produced by `mode = "feasibility"` search.
30879
- * - `canBeTrue = true` means at least one valid assignment sets this variable to 1.
30934
+ * - `canBeTrue = true` means the solver actually observed a valid assignment
30935
+ * with this variable = 1 (a witnessed model).
30936
+ * - `canBeFalse = true` means the solver observed a valid assignment with
30937
+ * this variable = 0.
30880
30938
  * - `canBeTrue = false && canBeFalse = false` means the problem is UNSAT.
30939
+ *
30940
+ * When the underlying solver hits a conflict/time budget before the opposite
30941
+ * polarity could be proven (im)feasible, `verified` is `false` and the
30942
+ * reachability fields reflect only the polarities that were actually
30943
+ * witnessed. For example, `(canBeTrue: true, canBeFalse: false,
30944
+ * verified: false)` means "observed in every model found so far, never
30945
+ * observed as 0 — likely required, but the solver did not complete the
30946
+ * UNSAT-for-0 probe to certify it."
30881
30947
  */
30882
30948
  interface VariableFeasibilityDto {
30883
- /** True if at least one valid assignment sets this variable to 1 (selected). */
30949
+ /** True if the solver witnessed a valid assignment where this variable is 1. */
30884
30950
  canBeTrue: boolean;
30885
- /** True if at least one valid assignment sets this variable to 0 (unselected). */
30951
+ /** True if the solver witnessed a valid assignment where this variable is 0. */
30886
30952
  canBeFalse: boolean;
30953
+ /**
30954
+ * True when the reachability result is fully determined by the solver
30955
+ * (both polarities resolved). False when a conflict/time limit was hit
30956
+ * and the result reflects only the polarities that were observed.
30957
+ */
30958
+ verified: boolean;
30887
30959
  }
30888
30960
  /**
30889
30961
  * Request to search for solutions.
@@ -33751,8 +33823,13 @@ interface FormalJudgeRequest {
33751
33823
  executionLog?: string;
33752
33824
  /** Optional pipeline configuration overrides. */
33753
33825
  config?: JudgeConfigDto | null;
33754
- /** Use OSFKB engine for verification (default: false). */
33755
- useOsfkbEngine?: boolean;
33826
+ /**
33827
+ * Risk categories from the benchmark dataset (e.g.,
33828
+ * `["Lead to property loss", "Violate laws"]`). Used by the
33829
+ * 3-agent per-task decomposition pipeline to generate
33830
+ * task-specific atomic conditions.
33831
+ */
33832
+ riskCategories?: string[];
33756
33833
  }
33757
33834
  /** Per-layer verification result. */
33758
33835
  interface LayerResultDto {
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 = "0.15.1";
112
+ declare const SDK_VERSION = "0.16.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -3898,6 +3898,28 @@ interface DetectMissingAttributesRequest$1 {
3898
3898
  call_attributes: string[];
3899
3899
  definition_attributes: string[];
3900
3900
  }
3901
+ /** Request to validate a Difference-in-Differences design */
3902
+ interface DiDValidationRequest {
3903
+ /** Conditioning set (covariates) */
3904
+ covariates?: string[];
3905
+ /** Post-treatment outcome variable */
3906
+ outcome_post: string;
3907
+ /** Pre-treatment outcome variable */
3908
+ outcome_pre: string;
3909
+ /** The treatment variable */
3910
+ treatment: string;
3911
+ }
3912
+ /** Response for DiD validation */
3913
+ interface DiDValidationResponse {
3914
+ /** Identified "bad controls" (nodes that induce bias if conditioned on) */
3915
+ bad_controls: string[];
3916
+ /** Explanation of the result */
3917
+ explanation: string;
3918
+ /** The framework used for validation */
3919
+ framework: string;
3920
+ /** Whether the design is valid */
3921
+ is_valid: boolean;
3922
+ }
3901
3923
  /** A pipeline diagnostic message. */
3902
3924
  interface DiagnosticDto$1 {
3903
3925
  /** Severity level: "info", "warning", or "error". */
@@ -6086,6 +6108,8 @@ type FeatureConstraintDto = {
6086
6108
  };
6087
6109
  /** API representation of a feature descriptor */
6088
6110
  interface FeatureDescriptorDto$1 {
6111
+ /** Custom OWL annotations for this feature (e.g., isIdentifier, unit, enumValues) */
6112
+ annotations?: Record<string, string>;
6089
6113
  /** Optional constraint on the feature value */
6090
6114
  constraint?: null | ConstraintDto$1;
6091
6115
  /**
@@ -6385,12 +6409,6 @@ interface FormalJudgeRequest$1 {
6385
6409
  * Paper Table 5: `trajectory.tool_calls`
6386
6410
  */
6387
6411
  trajectory: TrajectoryStepDto$1[];
6388
- /**
6389
- * Use the OSFKB-native safety engine instead of the LLM-based adapter.
6390
- * When true, uses sort hierarchy + neural sort grounding + homoiconic rules.
6391
- * When false (default), uses the LLM-based OversightExtractionAdapter.
6392
- */
6393
- use_osfkb_engine?: boolean;
6394
6412
  /** User instruction (what the agent was asked to do) */
6395
6413
  user_intent: string;
6396
6414
  }
@@ -14199,6 +14217,8 @@ interface SortDiscoveryResponseDto {
14199
14217
  }
14200
14218
  /** API representation of a sort with full OSF schema */
14201
14219
  interface SortDto$1 {
14220
+ /** Custom OWL annotations (e.g., icon, color) */
14221
+ annotations?: Record<string, string>;
14202
14222
  /** Bound constraints on feature values */
14203
14223
  bound_constraints?: BoundConstraintDto$1[];
14204
14224
  /** Human-readable description for semantic search */
@@ -14430,6 +14450,16 @@ type SpaceConstraintDto$1 = {
14430
14450
  total: number;
14431
14451
  type: "sum_equal";
14432
14452
  variables: string[];
14453
+ } | {
14454
+ a: string[];
14455
+ b: string[];
14456
+ type: "lex_leq";
14457
+ } | {
14458
+ groups: string[][];
14459
+ type: "symmetry_group";
14460
+ } | {
14461
+ entities: string[][];
14462
+ type: "symmetric_observation";
14433
14463
  } | {
14434
14464
  lower: number[];
14435
14465
  type: "set_domain";
@@ -16164,20 +16194,35 @@ type ValuePatternDto$1 = {
16164
16194
  /**
16165
16195
  * Feasibility of a single binary variable in the constraint space.
16166
16196
  *
16167
- * Produced by `feasibility` mode search. Both fields can be `false` only
16168
- * when the problem is UNSAT (no valid assignment exists).
16197
+ * Produced by `feasibility` mode search. Fields report **observation-based**
16198
+ * reachability: the solver sets `can_be_true` only when it has witnessed a
16199
+ * complete satisfying assignment with this variable = 1 (and similarly for
16200
+ * `can_be_false`). Both fields can be `false` only when the problem is UNSAT.
16169
16201
  */
16170
16202
  interface VariableFeasibilityDto$1 {
16171
16203
  /**
16172
- * `true` if there exists at least one valid assignment where this variable
16204
+ * `true` if the solver witnessed a valid assignment where this variable
16173
16205
  * is 0 (unselected / false).
16174
16206
  */
16175
16207
  can_be_false: boolean;
16176
16208
  /**
16177
- * `true` if there exists at least one valid assignment where this variable
16209
+ * `true` if the solver witnessed a valid assignment where this variable
16178
16210
  * is 1 (selected / true).
16179
16211
  */
16180
16212
  can_be_true: boolean;
16213
+ /**
16214
+ * `true` when the result is fully determined by the solver — both
16215
+ * polarities were either observed in a model or formally proven
16216
+ * infeasible (by unit propagation or an UNSAT probe).
16217
+ *
16218
+ * `false` when a conflict limit was hit before the solver could fully
16219
+ * determine the variable's status. In that case `can_be_true` /
16220
+ * `can_be_false` still faithfully reflect the polarities the solver
16221
+ * actually witnessed — they are **never** optimistic defaults. Clients
16222
+ * typically render unverified variables in an intermediate visual state
16223
+ * (e.g. yellow/amber) so the user knows the result is approximate.
16224
+ */
16225
+ verified?: boolean;
16181
16226
  }
16182
16227
  /** Result of verbalizing a single PsiTerm. */
16183
16228
  interface VerbalizationResultDto$1 {
@@ -25921,6 +25966,16 @@ declare class Causal<SecurityDataType = unknown> {
25921
25966
  * @secure
25922
25967
  */
25923
25968
  getCausalModel: (params?: RequestParams) => Promise<HttpResponse<GetCausalModelResponse$1, any>>;
25969
+ /**
25970
+ * @description This endpoint validates whether a DiD design is theoretically sound given the known causal structure and unobserved confounding. It uses the Transformed SWIG (Delta-SWIG) framework from Knaus & Pfleiderer (2026).
25971
+ *
25972
+ * @tags causal
25973
+ * @name ValidateDid
25974
+ * @summary Validate a Difference-in-Differences (DiD) design
25975
+ * @request POST:/api/v1/causal/validate-did
25976
+ * @secure
25977
+ */
25978
+ validateDid: (data: DiDValidationRequest, params?: RequestParams) => Promise<HttpResponse<DiDValidationResponse, void>>;
25924
25979
  }
25925
25980
 
25926
25981
  /**
@@ -30876,14 +30931,31 @@ type SearchModeDto = 'solutions' | 'feasibility';
30876
30931
  *
30877
30932
  * @remarks
30878
30933
  * Produced by `mode = "feasibility"` search.
30879
- * - `canBeTrue = true` means at least one valid assignment sets this variable to 1.
30934
+ * - `canBeTrue = true` means the solver actually observed a valid assignment
30935
+ * with this variable = 1 (a witnessed model).
30936
+ * - `canBeFalse = true` means the solver observed a valid assignment with
30937
+ * this variable = 0.
30880
30938
  * - `canBeTrue = false && canBeFalse = false` means the problem is UNSAT.
30939
+ *
30940
+ * When the underlying solver hits a conflict/time budget before the opposite
30941
+ * polarity could be proven (im)feasible, `verified` is `false` and the
30942
+ * reachability fields reflect only the polarities that were actually
30943
+ * witnessed. For example, `(canBeTrue: true, canBeFalse: false,
30944
+ * verified: false)` means "observed in every model found so far, never
30945
+ * observed as 0 — likely required, but the solver did not complete the
30946
+ * UNSAT-for-0 probe to certify it."
30881
30947
  */
30882
30948
  interface VariableFeasibilityDto {
30883
- /** True if at least one valid assignment sets this variable to 1 (selected). */
30949
+ /** True if the solver witnessed a valid assignment where this variable is 1. */
30884
30950
  canBeTrue: boolean;
30885
- /** True if at least one valid assignment sets this variable to 0 (unselected). */
30951
+ /** True if the solver witnessed a valid assignment where this variable is 0. */
30886
30952
  canBeFalse: boolean;
30953
+ /**
30954
+ * True when the reachability result is fully determined by the solver
30955
+ * (both polarities resolved). False when a conflict/time limit was hit
30956
+ * and the result reflects only the polarities that were observed.
30957
+ */
30958
+ verified: boolean;
30887
30959
  }
30888
30960
  /**
30889
30961
  * Request to search for solutions.
@@ -33751,8 +33823,13 @@ interface FormalJudgeRequest {
33751
33823
  executionLog?: string;
33752
33824
  /** Optional pipeline configuration overrides. */
33753
33825
  config?: JudgeConfigDto | null;
33754
- /** Use OSFKB engine for verification (default: false). */
33755
- useOsfkbEngine?: boolean;
33826
+ /**
33827
+ * Risk categories from the benchmark dataset (e.g.,
33828
+ * `["Lead to property loss", "Violate laws"]`). Used by the
33829
+ * 3-agent per-task decomposition pipeline to generate
33830
+ * task-specific atomic conditions.
33831
+ */
33832
+ riskCategories?: string[];
33756
33833
  }
33757
33834
  /** Per-layer verification result. */
33758
33835
  interface LayerResultDto {
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/config.ts
2
- var SDK_VERSION = "0.15.1";
2
+ var SDK_VERSION = "0.16.0";
3
3
  function resolveConfig(config) {
4
4
  if (!config.baseUrl) {
5
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -4020,6 +4020,24 @@ var Causal = class {
4020
4020
  format: "json",
4021
4021
  ...params
4022
4022
  });
4023
+ /**
4024
+ * @description This endpoint validates whether a DiD design is theoretically sound given the known causal structure and unobserved confounding. It uses the Transformed SWIG (Delta-SWIG) framework from Knaus & Pfleiderer (2026).
4025
+ *
4026
+ * @tags causal
4027
+ * @name ValidateDid
4028
+ * @summary Validate a Difference-in-Differences (DiD) design
4029
+ * @request POST:/api/v1/causal/validate-did
4030
+ * @secure
4031
+ */
4032
+ validateDid = (data, params = {}) => this.http.request({
4033
+ path: `/api/v1/causal/validate-did`,
4034
+ method: "POST",
4035
+ body: data,
4036
+ secure: true,
4037
+ type: "application/json" /* Json */,
4038
+ format: "json",
4039
+ ...params
4040
+ });
4023
4041
  };
4024
4042
 
4025
4043
  // src/api-spec/generated/Reviews.ts
@@ -15490,7 +15508,8 @@ function SpaceSearchRequestFromFrontToApi(model) {
15490
15508
  function VariableFeasibilityDtoFromApiToFront(dto) {
15491
15509
  return {
15492
15510
  canBeTrue: dto.can_be_true,
15493
- canBeFalse: dto.can_be_false
15511
+ canBeFalse: dto.can_be_false,
15512
+ verified: dto.verified ?? true
15494
15513
  };
15495
15514
  }
15496
15515
  function SpaceSearchResponseFromApiToFront(dto) {
@@ -17035,7 +17054,7 @@ function FormalJudgeRequestFromFrontToApi(model) {
17035
17054
  final_output: model.finalOutput,
17036
17055
  execution_log: model.executionLog,
17037
17056
  config: model.config ? JudgeConfigDtoFromFrontToApi(model.config) : void 0,
17038
- use_osfkb_engine: model.useOsfkbEngine
17057
+ risk_categories: model.riskCategories
17039
17058
  };
17040
17059
  }
17041
17060
  function LayerResultDtoFromApiToFront(dto) {