@kortexya/reasoninglayer 0.13.0 → 0.14.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.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.13.0";
112
+ declare const SDK_VERSION = "0.14.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -711,6 +711,39 @@ interface AgentSubVerdictDto$1 {
711
711
  /** Per-agent verdict: "safe", "unsafe", "partial", or "residuated" */
712
712
  verdict: string;
713
713
  }
714
+ /** Statistics for source text alignment quality */
715
+ interface AlignmentStatsDto {
716
+ /**
717
+ * Average fuzzy match ratio for fuzzy-aligned entities
718
+ * @format double
719
+ */
720
+ avg_fuzzy_ratio: number;
721
+ /**
722
+ * Number of entities with exact source text match
723
+ * @min 0
724
+ */
725
+ entities_aligned_exact: number;
726
+ /**
727
+ * Number of entities with fuzzy source text match
728
+ * @min 0
729
+ */
730
+ entities_aligned_fuzzy: number;
731
+ /**
732
+ * Number of entities with lesser (partial) source text match
733
+ * @min 0
734
+ */
735
+ entities_aligned_lesser: number;
736
+ /**
737
+ * Number of entities filtered out by alignment quality gate
738
+ * @min 0
739
+ */
740
+ entities_filtered_by_alignment: number;
741
+ /**
742
+ * Number of entities that could not be aligned to source text
743
+ * @min 0
744
+ */
745
+ entities_unaligned: number;
746
+ }
714
747
  /** Request to append residuations during unification */
715
748
  interface AppendResiduationsRequest$1 {
716
749
  session_id: string;
@@ -2941,6 +2974,57 @@ interface ContainmentVerificationDto$1 {
2941
2974
  */
2942
2975
  violation_count: number;
2943
2976
  }
2977
+ /**
2978
+ * Configuration for training on conversation data.
2979
+ *
2980
+ * Controls how synthetic conversation transcripts are generated
2981
+ * and scored during RL training with conversation environments.
2982
+ */
2983
+ interface ConversationTrainingConfigDto {
2984
+ /**
2985
+ * Optional agent ID to scope training to a specific agent's conversations
2986
+ * @format uuid
2987
+ */
2988
+ agent_id?: string | null;
2989
+ /**
2990
+ * Optional conversation IDs to train on specifically. When empty and
2991
+ * use_real_conversations is true, uses the most recent conversations.
2992
+ */
2993
+ conversation_ids?: string[];
2994
+ /**
2995
+ * Maximum turns per episode (default: 20)
2996
+ * @min 0
2997
+ */
2998
+ max_turns?: number;
2999
+ /**
3000
+ * Number of synthetic transcripts to generate for training (default: 10)
3001
+ * @min 0
3002
+ */
3003
+ num_transcripts?: number;
3004
+ /**
3005
+ * Reward for goal completion (default: 1.0)
3006
+ * @format double
3007
+ */
3008
+ reward_goal_completion?: number;
3009
+ /**
3010
+ * Step cost penalty (default: -0.01)
3011
+ * @format double
3012
+ */
3013
+ reward_step_cost?: number;
3014
+ /**
3015
+ * Reward for successful proof (default: 0.3)
3016
+ * @format double
3017
+ */
3018
+ reward_successful_proof?: number;
3019
+ /** Conversation topics for synthetic transcript generation */
3020
+ topics?: string[];
3021
+ /**
3022
+ * When true, loads actual conversation history from the knowledge base
3023
+ * instead of generating synthetic transcripts. The most recent N conversations
3024
+ * are used (controlled by num_transcripts).
3025
+ */
3026
+ use_real_conversations?: boolean;
3027
+ }
2944
3028
  /** A single coordinated resource set (N resources matched together) */
2945
3029
  interface CoordinatedResourceSet$1 {
2946
3030
  /**
@@ -5362,6 +5446,25 @@ interface EvidenceAssessmentResponse$1 {
5362
5446
  */
5363
5447
  truthfulness: number;
5364
5448
  }
5449
+ /** DTO for evidence derivation configuration (wire format). */
5450
+ interface EvidenceDerivationConfigDto$1 {
5451
+ /**
5452
+ * Relations whose polarity depends on the target entity's sort.
5453
+ * Maps relation name → list of target sort names that make it negative.
5454
+ */
5455
+ context_dependent_relations?: Record<string, string[]>;
5456
+ /**
5457
+ * Default quality weight for NER-derived evidence (0.0-1.0).
5458
+ * @format double
5459
+ */
5460
+ default_quality_weight?: number;
5461
+ /** Sort name to use for derived evidence terms. */
5462
+ evidence_sort_name?: string;
5463
+ /** Relation names that indicate contradiction. */
5464
+ negative_relations?: string[];
5465
+ /** Relation names that indicate support. */
5466
+ positive_relations?: string[];
5467
+ }
5365
5468
  /** A single piece of evidence used in assessment */
5366
5469
  interface EvidenceItemDto$1 {
5367
5470
  /**
@@ -5749,6 +5852,90 @@ interface ExtractionStatsDto$1 {
5749
5852
  */
5750
5853
  total_llm_calls: number;
5751
5854
  }
5855
+ /** Adaptive: auto-select strategy based on learned patterns. The fallback field accepts any ExtractionStrategy variant (e.g. {"type": "llm"}). */
5856
+ interface ExtractionStrategyAdaptive$1 {
5857
+ /**
5858
+ * Extraction strategy — an internally tagged enum discriminated by the 'type' field.
5859
+ * Variants:
5860
+ * - `{"type": "llm"}` — LLM-based extraction
5861
+ * - `{"type": "local_ner"}` — local NER model (GLiNER2)
5862
+ * - `{"type": "hybrid", "ner_confidence_threshold": 0.8}` — NER + LLM fallback
5863
+ * - `{"type": "schema_guided", ...}` — NER + pattern-based, LLM when needed
5864
+ * - `{"type": "adaptive", "fallback": {...}}` — auto-select strategy
5865
+ */
5866
+ fallback: ExtractionStrategyDto;
5867
+ /**
5868
+ * Discriminator -- always "adaptive".
5869
+ * @example "adaptive"
5870
+ */
5871
+ type: string;
5872
+ }
5873
+ /**
5874
+ * ExtractionStrategyDto
5875
+ * Extraction strategy — an internally tagged enum discriminated by the 'type' field.
5876
+ * Variants:
5877
+ * - `{"type": "llm"}` — LLM-based extraction
5878
+ * - `{"type": "local_ner"}` — local NER model (GLiNER2)
5879
+ * - `{"type": "hybrid", "ner_confidence_threshold": 0.8}` — NER + LLM fallback
5880
+ * - `{"type": "schema_guided", ...}` — NER + pattern-based, LLM when needed
5881
+ * - `{"type": "adaptive", "fallback": {...}}` — auto-select strategy
5882
+ */
5883
+ type ExtractionStrategyDto = ({
5884
+ type: "adaptive";
5885
+ } & ExtractionStrategyAdaptive$1) | ({
5886
+ type: "hybrid";
5887
+ } & ExtractionStrategyHybrid$1) | ({
5888
+ type: "llm";
5889
+ } & ExtractionStrategyLlm$1) | ({
5890
+ type: "local_ner";
5891
+ } & ExtractionStrategyLocalNer$1) | ({
5892
+ type: "schema_guided";
5893
+ } & ExtractionStrategySchemaGuided$1);
5894
+ interface ExtractionStrategyHybrid$1 {
5895
+ /**
5896
+ * NER confidence threshold below which to use LLM (0.0-1.0).
5897
+ * @format float
5898
+ */
5899
+ ner_confidence_threshold: number;
5900
+ /**
5901
+ * Discriminator -- always `"hybrid"`.
5902
+ * @example "hybrid"
5903
+ */
5904
+ type: string;
5905
+ }
5906
+ interface ExtractionStrategyLlm$1 {
5907
+ /**
5908
+ * Discriminator -- always `"llm"`.
5909
+ * @example "llm"
5910
+ */
5911
+ type: string;
5912
+ }
5913
+ interface ExtractionStrategyLocalNer$1 {
5914
+ /**
5915
+ * Discriminator -- always `"local_ner"`.
5916
+ * @example "local_ner"
5917
+ */
5918
+ type: string;
5919
+ }
5920
+ interface ExtractionStrategySchemaGuided$1 {
5921
+ /** Whether to escalate to LLM for unknown entity types. */
5922
+ escalate_unknown_types: boolean;
5923
+ /**
5924
+ * NER confidence threshold below which to escalate to LLM (0.0-1.0).
5925
+ * @format float
5926
+ */
5927
+ ner_confidence_threshold: number;
5928
+ /**
5929
+ * Relation pattern confidence threshold (0.0-1.0).
5930
+ * @format float
5931
+ */
5932
+ relation_confidence_threshold: number;
5933
+ /**
5934
+ * Discriminator -- always `"schema_guided"`.
5935
+ * @example "schema_guided"
5936
+ */
5937
+ type: string;
5938
+ }
5752
5939
  /** A fact confidence entry for tagged forward chaining. */
5753
5940
  interface FactConfidenceEntry$1 {
5754
5941
  /**
@@ -6633,6 +6820,12 @@ interface FuzzySubsumptionRequest$1 {
6633
6820
  * @format uuid
6634
6821
  */
6635
6822
  general_term_id: string;
6823
+ /**
6824
+ * Enable lenient primitive matching (default: true).
6825
+ * When true, string mismatches use semantic similarity instead of
6826
+ * requiring exact equality, and the similarity oracle is consulted.
6827
+ */
6828
+ lenient?: boolean | null;
6636
6829
  /**
6637
6830
  * The specific (more concrete) term ID
6638
6831
  * @format uuid
@@ -8237,6 +8430,14 @@ interface IngestionConfigDto$1 {
8237
8430
  * Default: true
8238
8431
  */
8239
8432
  enable_entity_filtering?: boolean;
8433
+ /**
8434
+ * Enable LLM-based evidence enrichment with statistical features.
8435
+ * After evidence terms are derived, makes one LLM call to extract
8436
+ * statistical measures (p-value, HR, CI, sample size, study design)
8437
+ * and attach them as features on evidence terms.
8438
+ * Default: false
8439
+ */
8440
+ enable_evidence_enrichment?: boolean;
8240
8441
  /**
8241
8442
  * Enable focused extraction prompts.
8242
8443
  * When schema discovery found types, uses a simplified prompt asking only
@@ -8257,16 +8458,30 @@ interface IngestionConfigDto$1 {
8257
8458
  * Default: false
8258
8459
  */
8259
8460
  enable_zero_degree_filtering?: boolean;
8461
+ /**
8462
+ * Configuration for deriving evidence terms from relational features.
8463
+ * When set, entities with Reference features (from NER relations) automatically
8464
+ * get linked evidence terms created, enabling OSFKB evidence assessment.
8465
+ */
8466
+ evidence_derivation_config?: null | EvidenceDerivationConfigDto$1;
8260
8467
  /** Whether to extract relations between entities */
8261
8468
  extract_relations?: boolean;
8262
8469
  /**
8263
- * Extraction strategy: "llm" (default), "local_ner" (GLiNER2), or "hybrid"
8470
+ * Extraction strategy -- an internally tagged object with a `"type"` discriminator.
8264
8471
  *
8265
- * - `llm`: Use LLM for all extraction (most capable, but slower and requires API)
8266
- * - `local_ner`: Use local NER model like GLiNER2 (fast, no API costs, privacy-friendly)
8267
- * - `hybrid`: Use NER first, fall back to LLM for low-confidence entities
8472
+ * Variants:
8473
+ * - `{"type": "llm"}` -- LLM for all extraction (default, most capable)
8474
+ * - `{"type": "local_ner"}` -- local NER model like GLiNER2 (fast, no API costs)
8475
+ * - `{"type": "hybrid", "ner_confidence_threshold": 0.8}` -- NER first, LLM fallback
8476
+ * - `{"type": "schema_guided", ...}` -- NER + pattern-based, LLM only when needed
8477
+ * - `{"type": "adaptive", "fallback": {...}}` -- auto-select based on learned patterns
8268
8478
  */
8269
- extraction_strategy?: string;
8479
+ extraction_strategy?: ExtractionStrategyDto;
8480
+ /**
8481
+ * When true, skip the auto-upgrade from Llm→LocalNer even if NER is available.
8482
+ * Used for A/B comparison tests. Default: false.
8483
+ */
8484
+ force_extraction_strategy?: boolean;
8270
8485
  /**
8271
8486
  * Maximum tokens for schema context passed to LLM
8272
8487
  * @min 0
@@ -8355,6 +8570,8 @@ interface IngestionSessionResponse$1 {
8355
8570
  type IngestionSessionStatusDto$1 = "active" | "paused" | "complete" | "failed";
8356
8571
  /** Ingestion statistics */
8357
8572
  interface IngestionStatsDto$1 {
8573
+ /** Source text alignment statistics (entity-to-source mapping quality) */
8574
+ alignment_stats?: AlignmentStatsDto;
8358
8575
  /**
8359
8576
  * Number of chunks that failed extraction
8360
8577
  * @min 0
@@ -8430,6 +8647,21 @@ interface IngestionStatsDto$1 {
8430
8647
  * @min 0
8431
8648
  */
8432
8649
  relations_integrated: number;
8650
+ /**
8651
+ * Number of suspended relations that remained unresolved (orphaned)
8652
+ * @min 0
8653
+ */
8654
+ relations_orphaned?: number;
8655
+ /**
8656
+ * Number of suspended relations successfully resumed when endpoints became available
8657
+ * @min 0
8658
+ */
8659
+ relations_resumed?: number;
8660
+ /**
8661
+ * Number of relations suspended (endpoints not yet available)
8662
+ * @min 0
8663
+ */
8664
+ relations_suspended?: number;
8433
8665
  /** Names of created/reused sorts */
8434
8666
  sort_names: string[];
8435
8667
  /**
@@ -8451,6 +8683,11 @@ interface IngestionStatsDto$1 {
8451
8683
  interface IntegratedCycleOutcomeDto$1 {
8452
8684
  /** Actions executed */
8453
8685
  actions_executed: string[];
8686
+ /**
8687
+ * Cognitive mode selected by System M meta-control (when enabled).
8688
+ * One of: "Explore", "Exploit", "Observe", "Consolidate", or null if meta-control disabled.
8689
+ */
8690
+ cognitive_mode?: string | null;
8454
8691
  /** Desires considered */
8455
8692
  desires_considered: string[];
8456
8693
  /**
@@ -8481,6 +8718,16 @@ interface IntegratedCycleOutcomeDto$1 {
8481
8718
  perceptions_processed: number;
8482
8719
  /** Prediction errors observed */
8483
8720
  prediction_errors: PredictionErrorDto$1[];
8721
+ /**
8722
+ * Whether the RL policy influenced this cycle's decisions.
8723
+ * True when enable_rl_policy is set and Q-values were found in the knowledge base.
8724
+ */
8725
+ rl_policy_active?: boolean;
8726
+ /**
8727
+ * Number of Q-value updates performed from rl_transition terms.
8728
+ * @min 0
8729
+ */
8730
+ rl_transitions_processed?: number;
8484
8731
  /**
8485
8732
  * Number of sensor percepts processed from external sensor ports
8486
8733
  * @min 0
@@ -8529,11 +8776,24 @@ interface IntegratedEngineConfigDto$1 {
8529
8776
  * @default true
8530
8777
  */
8531
8778
  enable_meta_cognition?: boolean;
8779
+ /**
8780
+ * Enable meta-control: System M dynamically selects cognitive modes
8781
+ * (Explore/Exploit/Observe/Consolidate) based on meta-signals.
8782
+ * @default false
8783
+ */
8784
+ enable_meta_control?: boolean;
8532
8785
  /**
8533
8786
  * Enable plan library lookup
8534
8787
  * @default true
8535
8788
  */
8536
8789
  enable_plan_library?: boolean;
8790
+ /**
8791
+ * Enable RL policy: agent uses Q-values from rl_transition Psi-terms for action selection.
8792
+ * When true, the agent reads trained Q-values from the shared TermStore (populated by
8793
+ * RL training) to guide cognitive decisions. Requires prior RL training on the same tenant.
8794
+ * @default false
8795
+ */
8796
+ enable_rl_policy?: boolean;
8537
8797
  /**
8538
8798
  * Enable mental simulation before execution
8539
8799
  * @default true
@@ -10479,11 +10739,22 @@ interface NeuroSymbolicStatusResponse$1 {
10479
10739
  status?: object | null;
10480
10740
  }
10481
10741
  /** Translation mode for NL queries */
10482
- type NlQueryMode$1 = "llm" | "constraint" | "cognitive";
10742
+ type NlQueryMode$1 = "llm" | "constraint" | "cognitive" | "triz";
10483
10743
  /** Natural language query request */
10484
10744
  interface NlQueryRequest$1 {
10745
+ /** Optional: confirm a TRIZ session (triggers invention pipeline) */
10746
+ confirm_session?: boolean | null;
10485
10747
  /** Optional conversation history for context (llm mode only) */
10486
10748
  conversation_history?: any[] | null;
10749
+ /** Optional: domain names to exclude from results */
10750
+ exclude_domains?: any[] | null;
10751
+ /**
10752
+ * Optional: focus on a specific proposal index (0-based) for refinement
10753
+ * @min 0
10754
+ */
10755
+ focus_proposal?: number | null;
10756
+ /** Optional images for multimodal TRIZ analysis (base64-encoded) */
10757
+ images?: any[] | null;
10487
10758
  /** Translation mode: "llm" (default), "constraint", or "cognitive" */
10488
10759
  mode?: NlQueryMode$1;
10489
10760
  /** The natural language question */
@@ -10516,14 +10787,20 @@ interface NlQueryResponse$1 {
10516
10787
  generated_osf?: string | null;
10517
10788
  /** Mode used for translation */
10518
10789
  mode: NlQueryMode$1;
10790
+ /** Novelty scores for inventive proposals */
10791
+ novelty_scores?: any[] | null;
10519
10792
  /** Original query */
10520
10793
  query: string;
10521
10794
  /** Results from query execution */
10522
10795
  results: NlQueryResultItem$1[];
10796
+ /** Structured problem from TRIZ session (for user confirmation) */
10797
+ structured_problem?: any;
10523
10798
  /** Whether the query was successful */
10524
10799
  success: boolean;
10525
10800
  /** Tool call info (constraint mode) */
10526
10801
  tool_call?: null | ToolCallInfo$1;
10802
+ /** TRIZ session status (for multi-turn refinement) */
10803
+ triz_session_status?: string | null;
10527
10804
  }
10528
10805
  /** Result item from NL query */
10529
10806
  interface NlQueryResultItem$1 {
@@ -11060,8 +11337,12 @@ interface PendingReviewDto$2 {
11060
11337
  }
11061
11338
  /** An entity pending review */
11062
11339
  interface PendingReviewEntityDto {
11340
+ /** Alignment status: "exact", "fuzzy", "lesser", or "unaligned" */
11341
+ alignment_status?: string | null;
11063
11342
  /** Candidate matches for deduplication */
11064
11343
  candidates: ReviewCandidateMatchDto$1[];
11344
+ /** Character interval in source text where entity was found (start, end) */
11345
+ char_interval?: any[] | null;
11065
11346
  /**
11066
11347
  * Extraction confidence score (0.0 - 1.0)
11067
11348
  * @format double
@@ -12669,6 +12950,8 @@ interface RlPolicyConfigDto$1 {
12669
12950
  * - Cognitive: Uses `rl_cognitive_bridge::run()` (unified cognitive-RL loop)
12670
12951
  */
12671
12952
  interface RlTrainRequest$1 {
12953
+ /** Configuration for conversation-based training (when environment_name starts with "conversation") */
12954
+ conversation_config?: null | ConversationTrainingConfigDto;
12672
12955
  /**
12673
12956
  * Curiosity bonus amount (default: 0.1)
12674
12957
  * @format double
@@ -12744,6 +13027,12 @@ interface RlTrainRequest$1 {
12744
13027
  * @min 0
12745
13028
  */
12746
13029
  num_episodes: number;
13030
+ /**
13031
+ * Enable saving/loading DQN weights for persistence across restarts.
13032
+ * When true, weights are saved to a tenant-specific path after training
13033
+ * and loaded before training starts (continuing from last checkpoint).
13034
+ */
13035
+ persist_weights?: boolean;
12747
13036
  /** Optional RL policy configuration overrides */
12748
13037
  rl_config?: null | RlPolicyConfigDto$1;
12749
13038
  /** Trajectory exchange mode: "top_k" | "all_to_all" | "ring" */
@@ -12787,6 +13076,8 @@ interface RlTrainResponse$1 {
12787
13076
  collapse_episodes?: number[];
12788
13077
  /** Contrastive losses from encoder training (empty if no encoder) */
12789
13078
  contrastive_losses?: number[];
13079
+ /** Conversation-specific metrics when training on conversation environment */
13080
+ conversation_decisions?: Record<string, number>;
12790
13081
  /**
12791
13082
  * Auto-curriculum adjustments
12792
13083
  * @min 0
@@ -18122,7 +18413,7 @@ declare namespace terms {
18122
18413
  }
18123
18414
 
18124
18415
  /** Translation mode for natural language queries. */
18125
- type NlQueryMode = 'llm' | 'constraint' | 'cognitive';
18416
+ type NlQueryMode = 'llm' | 'constraint' | 'cognitive' | 'triz';
18126
18417
  /** A result item from a natural language query. */
18127
18418
  interface NlQueryResultItem {
18128
18419
  /** Term ID. */
@@ -26352,6 +26643,102 @@ interface IngestionPollOptions {
26352
26643
  /** Optional callback invoked with progress data on each poll cycle. */
26353
26644
  onProgress?: (progress: SessionProgressResponse) => void;
26354
26645
  }
26646
+ /**
26647
+ * LLM-based extraction strategy — most capable, slower, requires API.
26648
+ *
26649
+ * @remarks
26650
+ * Wire format: `{"type": "llm"}`
26651
+ */
26652
+ interface ExtractionStrategyLlm {
26653
+ type: 'llm';
26654
+ }
26655
+ /**
26656
+ * Local NER extraction strategy — fast, no API costs, privacy-friendly.
26657
+ *
26658
+ * @remarks
26659
+ * Wire format: `{"type": "local_ner"}`
26660
+ */
26661
+ interface ExtractionStrategyLocalNer {
26662
+ type: 'local_ner';
26663
+ }
26664
+ /**
26665
+ * Hybrid extraction strategy — NER first, LLM fallback for low-confidence entities.
26666
+ *
26667
+ * @remarks
26668
+ * Wire format: `{"type": "hybrid", "ner_confidence_threshold": 0.8}`
26669
+ */
26670
+ interface ExtractionStrategyHybrid {
26671
+ type: 'hybrid';
26672
+ /** NER confidence threshold below which to escalate to LLM (0.0–1.0). */
26673
+ nerConfidenceThreshold: number;
26674
+ }
26675
+ /**
26676
+ * Schema-guided extraction strategy — NER + pattern-based, LLM only when needed.
26677
+ *
26678
+ * @remarks
26679
+ * Wire format: `{"type": "schema_guided", "ner_confidence_threshold": 0.7, "relation_confidence_threshold": 0.6, "escalate_unknown_types": true}`
26680
+ */
26681
+ interface ExtractionStrategySchemaGuided {
26682
+ type: 'schema_guided';
26683
+ /** NER confidence threshold below which to escalate to LLM (0.0–1.0). */
26684
+ nerConfidenceThreshold: number;
26685
+ /** Relation pattern confidence threshold (0.0–1.0). */
26686
+ relationConfidenceThreshold: number;
26687
+ /** Whether to escalate to LLM for unknown entity types. */
26688
+ escalateUnknownTypes: boolean;
26689
+ }
26690
+ /**
26691
+ * Adaptive extraction strategy — auto-select based on learned patterns.
26692
+ *
26693
+ * @remarks
26694
+ * Wire format: `{"type": "adaptive", "fallback": {...}}`
26695
+ */
26696
+ interface ExtractionStrategyAdaptive {
26697
+ type: 'adaptive';
26698
+ /** Fallback strategy when adaptive selection is inconclusive. */
26699
+ fallback: ExtractionStrategy;
26700
+ }
26701
+ /**
26702
+ * Extraction strategy for ingestion — an internally tagged discriminated union.
26703
+ *
26704
+ * @remarks
26705
+ * The backend serializes this with `#[serde(tag = "type", rename_all = "snake_case")]`.
26706
+ * The `type` field is the discriminator.
26707
+ *
26708
+ * @example
26709
+ * ```ts
26710
+ * // Simple strategies:
26711
+ * const llm: ExtractionStrategy = { type: 'llm' };
26712
+ * const ner: ExtractionStrategy = { type: 'local_ner' };
26713
+ *
26714
+ * // Strategies with parameters:
26715
+ * const hybrid: ExtractionStrategy = { type: 'hybrid', nerConfidenceThreshold: 0.8 };
26716
+ * const adaptive: ExtractionStrategy = { type: 'adaptive', fallback: { type: 'llm' } };
26717
+ * ```
26718
+ */
26719
+ type ExtractionStrategy = ExtractionStrategyLlm | ExtractionStrategyLocalNer | ExtractionStrategyHybrid | ExtractionStrategySchemaGuided | ExtractionStrategyAdaptive;
26720
+ /**
26721
+ * Configuration for deriving evidence terms from relational features.
26722
+ *
26723
+ * @remarks
26724
+ * When set, entities with Reference features (from NER relations) automatically
26725
+ * get linked evidence terms created, enabling OSFKB evidence assessment.
26726
+ */
26727
+ interface EvidenceDerivationConfigDto {
26728
+ /**
26729
+ * Relations whose polarity depends on the target entity's sort.
26730
+ * Maps relation name to list of target sort names that make it negative.
26731
+ */
26732
+ contextDependentRelations?: Record<string, string[]>;
26733
+ /** Default quality weight for NER-derived evidence (0.0–1.0). */
26734
+ defaultQualityWeight?: number;
26735
+ /** Sort name to use for derived evidence terms. */
26736
+ evidenceSortName?: string;
26737
+ /** Relation names that indicate contradiction. */
26738
+ negativeRelations?: string[];
26739
+ /** Relation names that indicate support. */
26740
+ positiveRelations?: string[];
26741
+ }
26355
26742
  /**
26356
26743
  * Ingestion session status.
26357
26744
  */
@@ -26451,12 +26838,35 @@ interface IngestionConfigDto {
26451
26838
  enableFocusedExtraction?: boolean;
26452
26839
  /** Enable schema discovery before extraction. Default: true. */
26453
26840
  enableSchemaDiscovery?: boolean;
26841
+ /** Enable LLM-based evidence enrichment with statistical features. Default: false. */
26842
+ enableEvidenceEnrichment?: boolean;
26454
26843
  /** Enable zero-degree entity removal. Default: false. */
26455
26844
  enableZeroDegreeFiltering?: boolean;
26845
+ /**
26846
+ * Configuration for deriving evidence terms from relational features.
26847
+ * When set, entities with Reference features automatically get linked evidence terms.
26848
+ */
26849
+ evidenceDerivationConfig?: EvidenceDerivationConfigDto | null;
26456
26850
  /** Whether to extract relations between entities. */
26457
26851
  extractRelations?: boolean;
26458
- /** Extraction strategy: "llm" (default), "local_ner", or "hybrid". */
26459
- extractionStrategy?: string;
26852
+ /**
26853
+ * Extraction strategy — an internally tagged discriminated union.
26854
+ *
26855
+ * @remarks
26856
+ * Wire format uses `#[serde(tag = "type")]`. Pass an object with a `type` discriminator.
26857
+ *
26858
+ * @example
26859
+ * ```ts
26860
+ * { type: 'llm' }
26861
+ * { type: 'hybrid', nerConfidenceThreshold: 0.8 }
26862
+ * ```
26863
+ */
26864
+ extractionStrategy?: ExtractionStrategy;
26865
+ /**
26866
+ * When true, skip the auto-upgrade from Llm to LocalNer even if NER is available.
26867
+ * Used for A/B comparison tests. Default: false.
26868
+ */
26869
+ forceExtractionStrategy?: boolean;
26460
26870
  /** Maximum tokens for schema context passed to LLM. */
26461
26871
  maxSchemaTokens?: number;
26462
26872
  /** NER confidence threshold (0.0 - 1.0). Default: 0.5. */
@@ -26467,6 +26877,12 @@ interface IngestionConfigDto {
26467
26877
  nerRelationConfidenceThreshold?: number;
26468
26878
  /** Relation labels for NER relation extraction. */
26469
26879
  nerRelationLabels?: string[];
26880
+ /**
26881
+ * Reject anonymized reference patterns from case studies.
26882
+ * Filters patterns like "Monsieur X", "société A", "Company A".
26883
+ * Only active when entity filtering is enabled. Default: true.
26884
+ */
26885
+ rejectAnonymizedReferences?: boolean;
26470
26886
  /** Skip fingerprint check (force re-ingestion). */
26471
26887
  skipFingerprint?: boolean;
26472
26888
  /** Skip automatic relation completion between extracted entities. */
@@ -26962,6 +27378,13 @@ type ingestion_DocumentProgressDto = DocumentProgressDto;
26962
27378
  type ingestion_DocumentSource = DocumentSource;
26963
27379
  type ingestion_DocumentStatsDto = DocumentStatsDto;
26964
27380
  type ingestion_DocumentType = DocumentType;
27381
+ type ingestion_EvidenceDerivationConfigDto = EvidenceDerivationConfigDto;
27382
+ type ingestion_ExtractionStrategy = ExtractionStrategy;
27383
+ type ingestion_ExtractionStrategyAdaptive = ExtractionStrategyAdaptive;
27384
+ type ingestion_ExtractionStrategyHybrid = ExtractionStrategyHybrid;
27385
+ type ingestion_ExtractionStrategyLlm = ExtractionStrategyLlm;
27386
+ type ingestion_ExtractionStrategyLocalNer = ExtractionStrategyLocalNer;
27387
+ type ingestion_ExtractionStrategySchemaGuided = ExtractionStrategySchemaGuided;
26965
27388
  type ingestion_GroundingStatsDto = GroundingStatsDto;
26966
27389
  type ingestion_IncompleteDocumentDto = IncompleteDocumentDto;
26967
27390
  type ingestion_IngestDocumentBatchRequest = IngestDocumentBatchRequest;
@@ -26994,7 +27417,7 @@ type ingestion_StartIngestionSessionRequest = StartIngestionSessionRequest;
26994
27417
  type ingestion_StepLogEntryDto = StepLogEntryDto;
26995
27418
  type ingestion_TokenUsageDto = TokenUsageDto;
26996
27419
  declare namespace ingestion {
26997
- export type { ingestion_AsyncIngestionResponse as AsyncIngestionResponse, ingestion_CandidateMatchDto as CandidateMatchDto, ingestion_ChunkFailureDto as ChunkFailureDto, ingestion_CommunityStatsDto as CommunityStatsDto, ingestion_DocumentBatchItem as DocumentBatchItem, ingestion_DocumentBatchResultDto as DocumentBatchResultDto, ingestion_DocumentMetadataDto as DocumentMetadataDto, ingestion_DocumentParseStatsDto as DocumentParseStatsDto, ingestion_DocumentParser as DocumentParser, ingestion_DocumentProgressDto as DocumentProgressDto, ingestion_DocumentSource as DocumentSource, ingestion_DocumentStatsDto as DocumentStatsDto, ingestion_DocumentType as DocumentType, ingestion_GroundingStatsDto as GroundingStatsDto, ingestion_IncompleteDocumentDto as IncompleteDocumentDto, ingestion_IngestDocumentBatchRequest as IngestDocumentBatchRequest, ingestion_IngestDocumentBatchResponse as IngestDocumentBatchResponse, ingestion_IngestDocumentRequest as IngestDocumentRequest, ingestion_IngestDocumentResponse as IngestDocumentResponse, ingestion_IngestMarkdownBatchRequest as IngestMarkdownBatchRequest, ingestion_IngestMarkdownRequest as IngestMarkdownRequest, ingestion_IngestMarkdownResponse as IngestMarkdownResponse, ingestion_IngestRdfRequest as IngestRdfRequest, ingestion_IngestRdfResponse as IngestRdfResponse, ingestion_IngestionConfigDto as IngestionConfigDto, ingestion_IngestionPollOptions as IngestionPollOptions, ingestion_IngestionSessionResponse as IngestionSessionResponse, ingestion_IngestionSessionStatusDto as IngestionSessionStatusDto, ingestion_IngestionStatsDto as IngestionStatsDto, ingestion_ListIncompleteDocumentsResponse as ListIncompleteDocumentsResponse, ingestion_ListIngestionSessionsResponse as ListIngestionSessionsResponse, ingestion_MarkdownDocumentDto as MarkdownDocumentDto, ingestion_OcrConfigDto as OcrConfigDto, ingestion_ParsedDocumentMetadataDto as ParsedDocumentMetadataDto, ingestion_PendingReviewDto as PendingReviewDto, ingestion_PipelineQualityStatsDto as PipelineQualityStatsDto, ingestion_RdfFormatDto as RdfFormatDto, ingestion_ResumeDocumentIngestionRequest as ResumeDocumentIngestionRequest, ingestion_ResumeDocumentIngestionResponse as ResumeDocumentIngestionResponse, ingestion_SessionProgressResponse as SessionProgressResponse, ingestion_SessionStatsResponse as SessionStatsResponse, ingestion_StartIngestionSessionRequest as StartIngestionSessionRequest, ingestion_StepLogEntryDto as StepLogEntryDto, ingestion_TokenUsageDto as TokenUsageDto };
27420
+ export type { ingestion_AsyncIngestionResponse as AsyncIngestionResponse, ingestion_CandidateMatchDto as CandidateMatchDto, ingestion_ChunkFailureDto as ChunkFailureDto, ingestion_CommunityStatsDto as CommunityStatsDto, ingestion_DocumentBatchItem as DocumentBatchItem, ingestion_DocumentBatchResultDto as DocumentBatchResultDto, ingestion_DocumentMetadataDto as DocumentMetadataDto, ingestion_DocumentParseStatsDto as DocumentParseStatsDto, ingestion_DocumentParser as DocumentParser, ingestion_DocumentProgressDto as DocumentProgressDto, ingestion_DocumentSource as DocumentSource, ingestion_DocumentStatsDto as DocumentStatsDto, ingestion_DocumentType as DocumentType, ingestion_EvidenceDerivationConfigDto as EvidenceDerivationConfigDto, ingestion_ExtractionStrategy as ExtractionStrategy, ingestion_ExtractionStrategyAdaptive as ExtractionStrategyAdaptive, ingestion_ExtractionStrategyHybrid as ExtractionStrategyHybrid, ingestion_ExtractionStrategyLlm as ExtractionStrategyLlm, ingestion_ExtractionStrategyLocalNer as ExtractionStrategyLocalNer, ingestion_ExtractionStrategySchemaGuided as ExtractionStrategySchemaGuided, ingestion_GroundingStatsDto as GroundingStatsDto, ingestion_IncompleteDocumentDto as IncompleteDocumentDto, ingestion_IngestDocumentBatchRequest as IngestDocumentBatchRequest, ingestion_IngestDocumentBatchResponse as IngestDocumentBatchResponse, ingestion_IngestDocumentRequest as IngestDocumentRequest, ingestion_IngestDocumentResponse as IngestDocumentResponse, ingestion_IngestMarkdownBatchRequest as IngestMarkdownBatchRequest, ingestion_IngestMarkdownRequest as IngestMarkdownRequest, ingestion_IngestMarkdownResponse as IngestMarkdownResponse, ingestion_IngestRdfRequest as IngestRdfRequest, ingestion_IngestRdfResponse as IngestRdfResponse, ingestion_IngestionConfigDto as IngestionConfigDto, ingestion_IngestionPollOptions as IngestionPollOptions, ingestion_IngestionSessionResponse as IngestionSessionResponse, ingestion_IngestionSessionStatusDto as IngestionSessionStatusDto, ingestion_IngestionStatsDto as IngestionStatsDto, ingestion_ListIncompleteDocumentsResponse as ListIncompleteDocumentsResponse, ingestion_ListIngestionSessionsResponse as ListIngestionSessionsResponse, ingestion_MarkdownDocumentDto as MarkdownDocumentDto, ingestion_OcrConfigDto as OcrConfigDto, ingestion_ParsedDocumentMetadataDto as ParsedDocumentMetadataDto, ingestion_PendingReviewDto as PendingReviewDto, ingestion_PipelineQualityStatsDto as PipelineQualityStatsDto, ingestion_RdfFormatDto as RdfFormatDto, ingestion_ResumeDocumentIngestionRequest as ResumeDocumentIngestionRequest, ingestion_ResumeDocumentIngestionResponse as ResumeDocumentIngestionResponse, ingestion_SessionProgressResponse as SessionProgressResponse, ingestion_SessionStatsResponse as SessionStatsResponse, ingestion_StartIngestionSessionRequest as StartIngestionSessionRequest, ingestion_StepLogEntryDto as StepLogEntryDto, ingestion_TokenUsageDto as TokenUsageDto };
26998
27421
  }
26999
27422
 
27000
27423
  /**