@kortexya/reasoninglayer 0.14.0 → 0.15.1

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.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.14.0";
112
+ declare const SDK_VERSION = "0.15.1";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -4468,16 +4468,6 @@ interface DocumentProgressDto$1 {
4468
4468
  inference_rules_applied: number;
4469
4469
  /** LLM model name (if applicable). */
4470
4470
  model_name?: string | null;
4471
- /**
4472
- * OSF residuations created.
4473
- * @min 0
4474
- */
4475
- osf_residuations_created: number;
4476
- /**
4477
- * OSF residuations resumed.
4478
- * @min 0
4479
- */
4480
- osf_residuations_resumed: number;
4481
4471
  /**
4482
4472
  * References resolved.
4483
4473
  * @min 0
@@ -4503,6 +4493,16 @@ interface DocumentProgressDto$1 {
4503
4493
  * @min 0
4504
4494
  */
4505
4495
  relations_integrated: number;
4496
+ /**
4497
+ * Residuations created (suspended operations).
4498
+ * @min 0
4499
+ */
4500
+ residuations_created: number;
4501
+ /**
4502
+ * Residuations resumed.
4503
+ * @min 0
4504
+ */
4505
+ residuations_resumed: number;
4506
4506
  /**
4507
4507
  * Reviews persisted.
4508
4508
  * @min 0
@@ -4520,11 +4520,6 @@ interface DocumentProgressDto$1 {
4520
4520
  * @min 0
4521
4521
  */
4522
4522
  sorts_reused: number;
4523
- /**
4524
- * Sorts reused via GLB/feature matching.
4525
- * @min 0
4526
- */
4527
- sorts_reused_glb: number;
4528
4523
  /**
4529
4524
  * Sorts reused via semantic matching.
4530
4525
  * @min 0
@@ -5109,6 +5104,27 @@ interface EntityDto$1 {
5109
5104
  */
5110
5105
  sort_id: string;
5111
5106
  }
5107
+ /** Audit record for one substring-based entity merge. */
5108
+ interface EntityMergeAuditDto {
5109
+ /**
5110
+ * Term ID of the entity that was merged away (the shorter form).
5111
+ * @format uuid
5112
+ */
5113
+ merged_from_id: string;
5114
+ /** Name of the merged-away entity. */
5115
+ merged_from_name: string;
5116
+ /** Original sort name of the merged-away entity. */
5117
+ merged_from_sort: string;
5118
+ /**
5119
+ * Term ID of the surviving entity (the longer/canonical form).
5120
+ * @format uuid
5121
+ */
5122
+ merged_into_id: string;
5123
+ /** Name of the surviving entity. */
5124
+ merged_into_name: string;
5125
+ /** Sort name of the surviving entity (which won the merge). */
5126
+ merged_into_sort: string;
5127
+ }
5112
5128
  /** Per-entity verification detail. */
5113
5129
  interface EntityVerificationDetailDto$1 {
5114
5130
  /**
@@ -8355,6 +8371,13 @@ interface IngestMarkdownRequest$1 {
8355
8371
  }
8356
8372
  /** Request to ingest RDF/OWL data */
8357
8373
  interface IngestRdfRequest$1 {
8374
+ /**
8375
+ * Whether to compute and store text embeddings for each ingested term.
8376
+ *
8377
+ * Default `true` because downstream extraction relies on embeddings.
8378
+ * Set to `false` only for opt-in fast structural-only ingest.
8379
+ */
8380
+ compute_embeddings?: boolean;
8358
8381
  /** RDF content in Turtle, N-Triples, or RDF/XML format */
8359
8382
  content: string;
8360
8383
  /** Format of the RDF content */
@@ -8364,7 +8387,7 @@ interface IngestRdfRequest$1 {
8364
8387
  /** Whether to also parse SHACL shapes from the content */
8365
8388
  parse_shacl?: boolean;
8366
8389
  }
8367
- /** Response from RDF ingestion */
8390
+ /** Response from RDF ingestion (sync mode, HTTP 201). */
8368
8391
  interface IngestRdfResponse$1 {
8369
8392
  /**
8370
8393
  * Number of SHACL shapes parsed
@@ -8445,6 +8468,17 @@ interface IngestionConfigDto$1 {
8445
8468
  * Default: true
8446
8469
  */
8447
8470
  enable_focused_extraction?: boolean;
8471
+ /**
8472
+ * Enable LLM-based coreference resolution for hard cases.
8473
+ * When true, after structural deduplication the pipeline runs parallel
8474
+ * per-pair LLM calls to resolve ambiguous coreferences (e.g.,
8475
+ * "Stanley Reed" vs "Justice Reed"). Adds LLM calls proportional to the
8476
+ * number of candidate pairs — violates the 0-LLM-token guarantee for the
8477
+ * LocalNer strategy, so disabled by default. Opt in to improve entity
8478
+ * deduplication quality at the cost of extra LLM calls.
8479
+ * Default: false
8480
+ */
8481
+ enable_llm_coreference?: boolean;
8448
8482
  /**
8449
8483
  * Enable schema discovery before extraction.
8450
8484
  * Samples the document to discover entity/relation types before per-chunk extraction.
@@ -8609,6 +8643,11 @@ interface IngestionStatsDto$1 {
8609
8643
  * @min 0
8610
8644
  */
8611
8645
  entities_pending_review: number;
8646
+ /**
8647
+ * Audit trail for substring-based entity merges (surface-form coreference).
8648
+ * E.g., "Brown v. Board" merged into "Brown v. Board of Education of Topeka".
8649
+ */
8650
+ entity_merge_audit?: EntityMergeAuditDto[];
8612
8651
  /**
8613
8652
  * Estimated USD cost of LLM API calls (if model pricing is available)
8614
8653
  * @format double
@@ -11388,25 +11427,20 @@ interface PipelineQualityStatsDto$1 {
11388
11427
  */
11389
11428
  dynamic_config_relation_threshold: number;
11390
11429
  /**
11391
- * Total formal concepts enumerated by FCA
11430
+ * Entities rejected by validation
11392
11431
  * @min 0
11393
11432
  */
11394
- fca_concepts_enumerated: number;
11433
+ entities_rejected: number;
11395
11434
  /**
11396
- * Concepts filtered (matching existing sorts)
11397
- * @min 0
11398
- */
11399
- fca_concepts_filtered: number;
11400
- /**
11401
- * Novel concepts discovered (not matching any existing sort)
11435
+ * Entities auto-corrected to a better sort
11402
11436
  * @min 0
11403
11437
  */
11404
- fca_novel_concepts: number;
11438
+ entities_sort_corrected: number;
11405
11439
  /**
11406
- * Sorts created from FCA-discovered concepts
11440
+ * Entities that passed validation
11407
11441
  * @min 0
11408
11442
  */
11409
- fca_sorts_created: number;
11443
+ entities_validated: number;
11410
11444
  /**
11411
11445
  * Axioms learned from entity feature patterns
11412
11446
  * @min 0
@@ -11418,75 +11452,76 @@ interface PipelineQualityStatsDto$1 {
11418
11452
  */
11419
11453
  feedback_pipeline_adjustments: number;
11420
11454
  /**
11421
- * LLM entities deduped against NER entities by normalized name in hybrid mode
11455
+ * Total quality issues from forward chaining
11422
11456
  * @min 0
11423
11457
  */
11424
- hybrid_intra_batch_deduped: number;
11458
+ forward_chaining_issues: number;
11425
11459
  /**
11426
- * Relations from inference rules deduplicated against existing
11460
+ * Entities fully valid (all constraints pass)
11427
11461
  * @min 0
11428
11462
  */
11429
- inference_relations_deduped: number;
11463
+ fully_valid: number;
11430
11464
  /**
11431
- * Inference rules successfully applied (expanded to relations)
11465
+ * LLM entities deduped against NER entities by normalized name in hybrid mode
11432
11466
  * @min 0
11433
11467
  */
11434
- inference_rules_applied: number;
11468
+ hybrid_intra_batch_deduped: number;
11435
11469
  /**
11436
- * Inference rules filtered due to low confidence
11470
+ * Entities missing required features
11437
11471
  * @min 0
11438
11472
  */
11439
- inference_rules_filtered_low_confidence: number;
11473
+ incomplete_entities: number;
11440
11474
  /**
11441
- * Inference rules with scope_sort not found among entities
11475
+ * Entities with incompatible sort assignments
11442
11476
  * @min 0
11443
11477
  */
11444
- inference_rules_invalid_scope_sort: number;
11478
+ inconsistent_sorts: number;
11445
11479
  /**
11446
- * Total inference rules extracted across all chunks
11480
+ * Number of forward-chaining iterations executed.
11447
11481
  * @min 0
11448
11482
  */
11449
- inference_rules_total: number;
11483
+ inference_iterations: number;
11450
11484
  /**
11451
- * Entities rejected by OSF validation
11485
+ * Relations from inference rules deduplicated against existing
11452
11486
  * @min 0
11453
11487
  */
11454
- osf_entities_rejected: number;
11488
+ inference_relations_deduped: number;
11455
11489
  /**
11456
- * Entities auto-corrected to a better sort
11490
+ * Inference rules successfully applied (expanded to relations)
11457
11491
  * @min 0
11458
11492
  */
11459
- osf_entities_sort_corrected: number;
11493
+ inference_rules_applied: number;
11460
11494
  /**
11461
- * Entities that passed OSF validation
11495
+ * Inference rules filtered due to low confidence
11462
11496
  * @min 0
11463
11497
  */
11464
- osf_entities_validated: number;
11498
+ inference_rules_filtered_low_confidence: number;
11465
11499
  /**
11466
- * Total quality issues from forward chaining
11500
+ * Inference rules with scope_sort not found among entities
11467
11501
  * @min 0
11468
11502
  */
11469
- osf_forward_chaining_issues: number;
11503
+ inference_rules_invalid_scope_sort: number;
11470
11504
  /**
11471
- * Entities fully valid (all constraints pass)
11505
+ * Total inference rules extracted across all chunks
11472
11506
  * @min 0
11473
11507
  */
11474
- osf_fully_valid: number;
11508
+ inference_rules_total: number;
11475
11509
  /**
11476
- * Entities missing required features (from forward chaining)
11510
+ * Pattern rules generated from co-occurrence analysis.
11511
+ * These are homoiconic Ψ-term rules persisted to the term store.
11477
11512
  * @min 0
11478
11513
  */
11479
- osf_incomplete_entities: number;
11514
+ pattern_rules_persisted: number;
11480
11515
  /**
11481
- * Entities with incompatible sort assignments
11516
+ * Total relations generated from inference rule expansion
11482
11517
  * @min 0
11483
11518
  */
11484
- osf_inconsistent_sorts: number;
11519
+ relations_from_inference_rules: number;
11485
11520
  /**
11486
- * Total relations generated from inference rule expansion
11521
+ * Total relations derived by forward chaining.
11487
11522
  * @min 0
11488
11523
  */
11489
- relations_from_inference_rules: number;
11524
+ relations_inferred: number;
11490
11525
  }
11491
11526
  /** A matching plan from the library. */
11492
11527
  interface PlanMatchDto$1 {
@@ -13587,6 +13622,13 @@ interface SearchCommunitiesResponse$1 {
13587
13622
  /** Search statistics */
13588
13623
  stats: CommunitySearchStatsDto$1;
13589
13624
  }
13625
+ /**
13626
+ * Which computation the search endpoint should perform.
13627
+ *
13628
+ * Defaults to `solutions` for full backward compatibility with existing clients
13629
+ * that do not send a `mode` field.
13630
+ */
13631
+ type SearchModeDto$1 = "solutions" | "feasibility";
13590
13632
  /** Request to search for solutions */
13591
13633
  interface SearchRequest {
13592
13634
  /**
@@ -13596,10 +13638,15 @@ interface SearchRequest {
13596
13638
  */
13597
13639
  collect_traces?: boolean | null;
13598
13640
  /**
13599
- * Maximum number of solutions to find
13641
+ * Maximum number of solutions to find (only used in `solutions` mode)
13600
13642
  * @min 0
13601
13643
  */
13602
13644
  max_solutions?: number | null;
13645
+ /**
13646
+ * Which computation to perform. Omit or set to `"solutions"` for the
13647
+ * default enumeration behaviour (backward compatible).
13648
+ */
13649
+ mode?: SearchModeDto$1;
13603
13650
  /** Search strategy to use */
13604
13651
  strategy: SearchStrategyDto$1;
13605
13652
  /**
@@ -13609,18 +13656,36 @@ interface SearchRequest {
13609
13656
  */
13610
13657
  use_neural_guidance?: boolean | null;
13611
13658
  }
13612
- /** Response with search results */
13613
- interface SearchResponse {
13659
+ /**
13660
+ * Response from the search endpoint.
13661
+ *
13662
+ * The `kind` field is a discriminator — always read it first to know which
13663
+ * variant you received before accessing the mode-specific fields.
13664
+ */
13665
+ type SearchResponse = {
13614
13666
  /**
13615
- * Total number of solutions found
13667
+ * Number of solutions found.
13616
13668
  * @min 0
13617
13669
  */
13618
13670
  count: number;
13619
- /** Search statistics (present when collect_traces is true or use_neural_guidance is true) */
13671
+ kind: "solutions";
13672
+ /**
13673
+ * Search statistics (present when `collect_traces` or `use_neural_guidance`
13674
+ * is true, or when the SAT solver was used).
13675
+ */
13620
13676
  search_stats?: null | SearchStatsDto$1;
13621
- /** Solutions found */
13677
+ /** Enumerated complete assignments. */
13622
13678
  solutions: SpaceSolutionDto$1[];
13623
- }
13679
+ } | {
13680
+ kind: "feasibility";
13681
+ /** Solver statistics for the feasibility queries. */
13682
+ search_stats?: null | SearchStatsDto$1;
13683
+ /**
13684
+ * Per-variable feasibility. Key is the variable name as registered
13685
+ * in the space's choice points.
13686
+ */
13687
+ variables: Record<string, VariableFeasibilityDto$1>;
13688
+ };
13624
13689
  /**
13625
13690
  * Search statistics collected during a search operation.
13626
13691
  *
@@ -13633,6 +13698,19 @@ interface SearchStatsDto$1 {
13633
13698
  * @min 0
13634
13699
  */
13635
13700
  backtracks: number;
13701
+ /**
13702
+ * Choice points that were forced by initial propagation (before any
13703
+ * search decision). Each entry is an unbiased "confirmed" assignment:
13704
+ * every solution in the search space respects it. Clients should use
13705
+ * this list (not the intersection of enumerated solutions) to display
13706
+ * which choices are definitively locked in.
13707
+ */
13708
+ forced_choices?: ChoiceSelection$1[];
13709
+ /**
13710
+ * Number of learned nogood clauses.
13711
+ * @min 0
13712
+ */
13713
+ learned_clauses: number;
13636
13714
  /**
13637
13715
  * Total nodes visited during search.
13638
13716
  * @min 0
@@ -13643,6 +13721,11 @@ interface SearchStatsDto$1 {
13643
13721
  * @min 0
13644
13722
  */
13645
13723
  nodes_pruned: number;
13724
+ /**
13725
+ * Number of restarts performed (Luby restart strategy).
13726
+ * @min 0
13727
+ */
13728
+ restarts: number;
13646
13729
  /**
13647
13730
  * Number of times the neural scorer was invoked.
13648
13731
  * @min 0
@@ -16078,6 +16161,24 @@ type ValuePatternDto$1 = {
16078
16161
  type: "bind";
16079
16162
  variable: string;
16080
16163
  };
16164
+ /**
16165
+ * Feasibility of a single binary variable in the constraint space.
16166
+ *
16167
+ * Produced by `feasibility` mode search. Both fields can be `false` only
16168
+ * when the problem is UNSAT (no valid assignment exists).
16169
+ */
16170
+ interface VariableFeasibilityDto$1 {
16171
+ /**
16172
+ * `true` if there exists at least one valid assignment where this variable
16173
+ * is 0 (unselected / false).
16174
+ */
16175
+ can_be_false: boolean;
16176
+ /**
16177
+ * `true` if there exists at least one valid assignment where this variable
16178
+ * is 1 (selected / true).
16179
+ */
16180
+ can_be_true: boolean;
16181
+ }
16081
16182
  /** Result of verbalizing a single PsiTerm. */
16082
16183
  interface VerbalizationResultDto$1 {
16083
16184
  /**
@@ -26373,15 +26474,18 @@ declare class Ingestion<SecurityDataType = unknown> {
26373
26474
  */
26374
26475
  ingestMarkdownBatch: (data: IngestMarkdownBatchRequest$1, params?: RequestParams) => Promise<HttpResponse<void, void>>;
26375
26476
  /**
26376
- * No description
26477
+ * @description Defaults to async dispatch: returns `202` with a session id and the pipeline runs in a background tokio task. Pass `?sync=true` to run the whole pipeline inside the request and get a `201` with the full result — suitable only for small ontologies because the embedding loop dominates wall time on large inputs.
26377
26478
  *
26378
26479
  * @tags ingestion
26379
26480
  * @name IngestRdf
26380
- * @summary Ingest RDF/OWL/SHACL data and convert to OSF
26481
+ * @summary Ingest RDF/OWL/SHACL data and convert to OSF.
26381
26482
  * @request POST:/api/v1/ingest/rdf
26382
26483
  * @secure
26383
26484
  */
26384
- ingestRdf: (data: IngestRdfRequest$1, params?: RequestParams) => Promise<HttpResponse<IngestRdfResponse$1, void>>;
26485
+ ingestRdf: (query: {
26486
+ /** When true, run synchronously (returns 201). Default false: returns 202 with a session id. */
26487
+ sync: boolean;
26488
+ }, data: IngestRdfRequest$1, params?: RequestParams) => Promise<HttpResponse<IngestRdfResponse$1, void>>;
26385
26489
  /**
26386
26490
  * @description Returns paginated list of chunk failures in the dead-letter queue.
26387
26491
  *
@@ -26548,10 +26652,10 @@ interface DocumentProgressDto {
26548
26652
  inferenceRulesApplied: number;
26549
26653
  /** LLM model name (if applicable). */
26550
26654
  modelName?: string | null;
26551
- /** OSF residuations created. */
26552
- osfResiduationsCreated: number;
26553
- /** OSF residuations resumed. */
26554
- osfResiduationsResumed: number;
26655
+ /** Residuations created (suspended operations). */
26656
+ residuationsCreated: number;
26657
+ /** Residuations resumed. */
26658
+ residuationsResumed: number;
26555
26659
  /** References resolved. */
26556
26660
  referencesResolved: number;
26557
26661
  /** Unresolved references. */
@@ -26570,8 +26674,6 @@ interface DocumentProgressDto {
26570
26674
  sortsCreated: number;
26571
26675
  /** Existing sorts reused (exact match). */
26572
26676
  sortsReused: number;
26573
- /** Sorts reused via GLB/feature matching. */
26574
- sortsReusedGlb: number;
26575
26677
  /** Sorts reused via semantic matching. */
26576
26678
  sortsReusedSemantic: number;
26577
26679
  /** When ingestion started (ISO 8601). */
@@ -26941,20 +27043,28 @@ interface PipelineQualityStatsDto {
26941
27043
  dynamicConfigEntityThreshold: number;
26942
27044
  /** Dynamic relation confidence threshold based on KB maturity. */
26943
27045
  dynamicConfigRelationThreshold: number;
26944
- /** Total formal concepts enumerated by FCA. */
26945
- fcaConceptsEnumerated: number;
26946
- /** Concepts filtered (matching existing sorts). */
26947
- fcaConceptsFiltered: number;
26948
- /** Novel concepts discovered (not matching any existing sort). */
26949
- fcaNovelConcepts: number;
26950
- /** Sorts created from FCA-discovered concepts. */
26951
- fcaSortsCreated: number;
27046
+ /** Entities rejected by validation. */
27047
+ entitiesRejected: number;
27048
+ /** Entities auto-corrected to a better sort. */
27049
+ entitiesSortCorrected: number;
27050
+ /** Entities that passed validation. */
27051
+ entitiesValidated: number;
26952
27052
  /** Axioms learned from entity feature patterns. */
26953
27053
  feedbackAxiomsLearned: number;
26954
27054
  /** Pipeline threshold adjustments applied by dynamic config. */
26955
27055
  feedbackPipelineAdjustments: number;
27056
+ /** Total quality issues from forward chaining. */
27057
+ forwardChainingIssues: number;
27058
+ /** Entities fully valid (all constraints pass). */
27059
+ fullyValid: number;
26956
27060
  /** LLM entities deduped against NER entities by normalized name in hybrid mode. */
26957
27061
  hybridIntraBatchDeduped: number;
27062
+ /** Entities missing required features. */
27063
+ incompleteEntities: number;
27064
+ /** Entities with incompatible sort assignments. */
27065
+ inconsistentSorts: number;
27066
+ /** Number of forward-chaining iterations executed. */
27067
+ inferenceIterations: number;
26958
27068
  /** Relations from inference rules deduplicated against existing. */
26959
27069
  inferenceRelationsDeduped: number;
26960
27070
  /** Inference rules successfully applied (expanded to relations). */
@@ -26965,18 +27075,12 @@ interface PipelineQualityStatsDto {
26965
27075
  inferenceRulesInvalidScopeSort: number;
26966
27076
  /** Total inference rules extracted across all chunks. */
26967
27077
  inferenceRulesTotal: number;
26968
- /** Entities rejected by validation. */
26969
- osfEntitiesRejected: number;
26970
- /** Entities auto-corrected to a better sort. */
26971
- osfEntitiesSortCorrected: number;
26972
- /** Entities that passed validation. */
26973
- osfEntitiesValidated: number;
26974
- /** Total quality issues from forward chaining. */
26975
- osfForwardChainingIssues: number;
26976
- /** Entities fully valid (all constraints pass). */
26977
- osfFullyValid: number;
26978
- /** Entities missing required features (from forward chaining). */
26979
- osfIncompleteEntities: number;
27078
+ /** Pattern rules generated from co-occurrence analysis. */
27079
+ patternRulesPersisted: number;
27080
+ /** Total relations generated from inference rule expansion. */
27081
+ relationsFromInferenceRules: number;
27082
+ /** Total relations derived by forward chaining. */
27083
+ relationsInferred: number;
26980
27084
  }
26981
27085
  /**
26982
27086
  * Token usage from LLM API calls during ingestion.
@@ -27221,6 +27325,11 @@ interface IngestRdfRequest {
27221
27325
  parseOntology?: boolean;
27222
27326
  /** Whether to also parse SHACL shapes from the content. */
27223
27327
  parseShacl?: boolean;
27328
+ /**
27329
+ * When true, run synchronously and return the result immediately (HTTP 201).
27330
+ * When false (default), return HTTP 202 with a session ID for async polling.
27331
+ */
27332
+ sync?: boolean;
27224
27333
  /** Tenant ID for the ingested data. */
27225
27334
  tenantId: string;
27226
27335
  }
@@ -30684,6 +30793,15 @@ interface SearchStatsDto {
30684
30793
  solveTimeMs: number;
30685
30794
  /** Number of times the neural scorer was invoked. */
30686
30795
  scorerCalls: number;
30796
+ /** Number of restarts performed (Luby restart strategy). */
30797
+ restarts: number;
30798
+ /** Number of learned nogood clauses. */
30799
+ learnedClauses: number;
30800
+ /**
30801
+ * Choice points forced by initial propagation (before any search decision).
30802
+ * Every solution in the search space respects these assignments unconditionally.
30803
+ */
30804
+ forcedChoices?: ChoiceSelection[];
30687
30805
  }
30688
30806
  /**
30689
30807
  * Trace event from LIFE feature operations during search.
@@ -30744,35 +30862,81 @@ interface CommitRequest {
30744
30862
  /** Index of the alternative to commit to. */
30745
30863
  alternativeIndex: number;
30746
30864
  }
30865
+ /**
30866
+ * Which computation the search endpoint should perform.
30867
+ *
30868
+ * @remarks
30869
+ * - `"solutions"`: enumerate complete, valid assignments (default — backward compatible).
30870
+ * - `"feasibility"`: run 2×N per-variable SAT queries and return reachability info.
30871
+ * Much faster than full enumeration for large spaces.
30872
+ */
30873
+ type SearchModeDto = 'solutions' | 'feasibility';
30874
+ /**
30875
+ * Reachability of a single binary choice-point variable.
30876
+ *
30877
+ * @remarks
30878
+ * Produced by `mode = "feasibility"` search.
30879
+ * - `canBeTrue = true` means at least one valid assignment sets this variable to 1.
30880
+ * - `canBeTrue = false && canBeFalse = false` means the problem is UNSAT.
30881
+ */
30882
+ interface VariableFeasibilityDto {
30883
+ /** True if at least one valid assignment sets this variable to 1 (selected). */
30884
+ canBeTrue: boolean;
30885
+ /** True if at least one valid assignment sets this variable to 0 (unselected). */
30886
+ canBeFalse: boolean;
30887
+ }
30747
30888
  /**
30748
30889
  * Request to search for solutions.
30749
30890
  */
30750
30891
  interface SpaceSearchRequest {
30751
30892
  /** Search strategy to use. */
30752
30893
  strategy: SearchStrategyDto;
30753
- /** Maximum number of solutions to find. */
30894
+ /** Maximum number of solutions to find (only used in `"solutions"` mode). */
30754
30895
  maxSolutions?: number | null;
30755
30896
  /** Enable trace collection during search. */
30756
30897
  collectTraces?: boolean | null;
30757
30898
  /** Wire the neural scorer into search (AlphaProof-style guidance). */
30758
30899
  useNeuralGuidance?: boolean | null;
30900
+ /**
30901
+ * Which computation to perform.
30902
+ * Omit or set to `"solutions"` for the default enumeration behaviour (backward compatible).
30903
+ */
30904
+ mode?: SearchModeDto;
30759
30905
  }
30760
30906
  /**
30761
- * Response with search results.
30907
+ * Response from the search endpoint.
30908
+ *
30909
+ * @remarks
30910
+ * Discriminated union on `kind`. Always read `kind` first:
30911
+ * - `"solutions"`: standard enumeration result with `solutions` and `count`.
30912
+ * - `"feasibility"`: per-variable reachability map in `variables`.
30762
30913
  */
30763
- interface SpaceSearchResponse {
30764
- /** Solutions found. */
30914
+ type SpaceSearchResponse = {
30915
+ /** Discriminator — always `"solutions"` for this variant. */
30916
+ kind: 'solutions';
30917
+ /** Enumerated complete assignments. */
30765
30918
  solutions: SpaceSolutionDto[];
30766
- /** Total number of solutions found. */
30919
+ /** Number of solutions found. */
30767
30920
  count: number;
30768
30921
  /** Search statistics. */
30769
30922
  searchStats?: SearchStatsDto | null;
30770
- }
30923
+ } | {
30924
+ /** Discriminator — always `"feasibility"` for this variant. */
30925
+ kind: 'feasibility';
30926
+ /**
30927
+ * Per-variable reachability. Key is the variable name as registered
30928
+ * in the space's choice points.
30929
+ */
30930
+ variables: Record<string, VariableFeasibilityDto>;
30931
+ /** Solver statistics for the feasibility queries. */
30932
+ searchStats?: SearchStatsDto | null;
30933
+ };
30771
30934
 
30772
30935
  type spaces_ChoicePointDto = ChoicePointDto;
30773
30936
  type spaces_ChoiceSelection = ChoiceSelection;
30774
30937
  type spaces_CommitRequest = CommitRequest;
30775
30938
  type spaces_CreateSpaceRequest = CreateSpaceRequest;
30939
+ type spaces_SearchModeDto = SearchModeDto;
30776
30940
  type spaces_SearchStatsDto = SearchStatsDto;
30777
30941
  type spaces_SearchStrategyDto = SearchStrategyDto;
30778
30942
  type spaces_SpaceConstraintDto = SpaceConstraintDto;
@@ -30782,8 +30946,9 @@ type spaces_SpaceSearchResponse = SpaceSearchResponse;
30782
30946
  type spaces_SpaceSolutionDto = SpaceSolutionDto;
30783
30947
  type spaces_SpaceStatusDto = SpaceStatusDto;
30784
30948
  type spaces_TraceEventDto = TraceEventDto;
30949
+ type spaces_VariableFeasibilityDto = VariableFeasibilityDto;
30785
30950
  declare namespace spaces {
30786
- export type { spaces_ChoicePointDto as ChoicePointDto, spaces_ChoiceSelection as ChoiceSelection, spaces_CommitRequest as CommitRequest, spaces_CreateSpaceRequest as CreateSpaceRequest, spaces_SearchStatsDto as SearchStatsDto, spaces_SearchStrategyDto as SearchStrategyDto, spaces_SpaceConstraintDto as SpaceConstraintDto, spaces_SpaceResponse as SpaceResponse, spaces_SpaceSearchRequest as SpaceSearchRequest, spaces_SpaceSearchResponse as SpaceSearchResponse, spaces_SpaceSolutionDto as SpaceSolutionDto, spaces_SpaceStatusDto as SpaceStatusDto, spaces_TraceEventDto as TraceEventDto };
30951
+ export type { spaces_ChoicePointDto as ChoicePointDto, spaces_ChoiceSelection as ChoiceSelection, spaces_CommitRequest as CommitRequest, spaces_CreateSpaceRequest as CreateSpaceRequest, spaces_SearchModeDto as SearchModeDto, spaces_SearchStatsDto as SearchStatsDto, spaces_SearchStrategyDto as SearchStrategyDto, spaces_SpaceConstraintDto as SpaceConstraintDto, spaces_SpaceResponse as SpaceResponse, spaces_SpaceSearchRequest as SpaceSearchRequest, spaces_SpaceSearchResponse as SpaceSearchResponse, spaces_SpaceSolutionDto as SpaceSolutionDto, spaces_SpaceStatusDto as SpaceStatusDto, spaces_TraceEventDto as TraceEventDto, spaces_VariableFeasibilityDto as VariableFeasibilityDto };
30787
30952
  }
30788
30953
 
30789
30954
  /**