@sovr/engine 3.5.0 → 3.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.mts +414 -1
- package/dist/index.d.ts +414 -1
- package/dist/index.js +1066 -0
- package/dist/index.mjs +1062 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1870,6 +1870,419 @@ declare class ContextAccelerator {
|
|
|
1870
1870
|
private evictLRU;
|
|
1871
1871
|
}
|
|
1872
1872
|
|
|
1873
|
+
/**
|
|
1874
|
+
* trendAlertEngine.ts — 趋势触发告警与 Kill-Switch 对接引擎
|
|
1875
|
+
*
|
|
1876
|
+
* 覆盖 PDF5: 人工智能痛点执行方案(1) — 趋势触发告警与 Kill-Switch 对接
|
|
1877
|
+
*
|
|
1878
|
+
* 核心能力:
|
|
1879
|
+
* - Block Rate 突增检测: 拦截率相对基线大幅上升
|
|
1880
|
+
* - Override Rate 突增检测: 人工强制通过率飙升
|
|
1881
|
+
* - 未知原因码检测: 出现未定义的 reason_code
|
|
1882
|
+
* - 人工审批队列积压检测: 审核队列任务大量堆积
|
|
1883
|
+
* - 自动降级 (Degrade): 进入降级模式
|
|
1884
|
+
* - 自动提高门槛: 提升安全阈值
|
|
1885
|
+
* - 触发 Kill-Switch: 全局紧急停止
|
|
1886
|
+
* - 告警事件持久化: 写入 sovr_system_events
|
|
1887
|
+
* - DegradeEvaluator Cron: 定时评估趋势
|
|
1888
|
+
*/
|
|
1889
|
+
type AlertSeverity = 'INFO' | 'WARN' | 'CRITICAL' | 'EMERGENCY';
|
|
1890
|
+
type AlertType = 'BLOCK_RATE_SURGE' | 'OVERRIDE_RATE_SURGE' | 'UNKNOWN_REASON_CODE' | 'APPROVAL_QUEUE_BACKLOG' | 'CONFIDENCE_DROP' | 'LATENCY_SPIKE' | 'ERROR_RATE_SURGE';
|
|
1891
|
+
type ProtectiveAction = 'DEGRADE' | 'TIGHTEN_THRESHOLD' | 'KILL_SWITCH' | 'NOTIFY_ONLY' | 'FORCE_HUMAN_GATE';
|
|
1892
|
+
interface AlertThreshold {
|
|
1893
|
+
alert_type: AlertType;
|
|
1894
|
+
metric_name: string;
|
|
1895
|
+
baseline_window_hours: number;
|
|
1896
|
+
surge_multiplier: number;
|
|
1897
|
+
absolute_threshold: number;
|
|
1898
|
+
severity: AlertSeverity;
|
|
1899
|
+
protective_actions: ProtectiveAction[];
|
|
1900
|
+
cooldown_seconds: number;
|
|
1901
|
+
enabled: boolean;
|
|
1902
|
+
}
|
|
1903
|
+
interface TrendMetric {
|
|
1904
|
+
metric_name: string;
|
|
1905
|
+
current_value: number;
|
|
1906
|
+
baseline_value: number;
|
|
1907
|
+
window_start: number;
|
|
1908
|
+
window_end: number;
|
|
1909
|
+
sample_count: number;
|
|
1910
|
+
}
|
|
1911
|
+
interface AlertEvent {
|
|
1912
|
+
alert_id: string;
|
|
1913
|
+
alert_type: AlertType;
|
|
1914
|
+
severity: AlertSeverity;
|
|
1915
|
+
metric_name: string;
|
|
1916
|
+
current_value: number;
|
|
1917
|
+
baseline_value: number;
|
|
1918
|
+
threshold_value: number;
|
|
1919
|
+
surge_ratio: number;
|
|
1920
|
+
protective_actions_taken: ProtectiveAction[];
|
|
1921
|
+
message: string;
|
|
1922
|
+
tenant_id: string;
|
|
1923
|
+
created_at: number;
|
|
1924
|
+
acknowledged: boolean;
|
|
1925
|
+
acknowledged_by: string | null;
|
|
1926
|
+
acknowledged_at: number | null;
|
|
1927
|
+
}
|
|
1928
|
+
interface KillSwitchState {
|
|
1929
|
+
enabled: boolean;
|
|
1930
|
+
reason: string | null;
|
|
1931
|
+
enabled_at: number | null;
|
|
1932
|
+
enabled_by: string;
|
|
1933
|
+
auto_triggered: boolean;
|
|
1934
|
+
}
|
|
1935
|
+
interface DegradeState {
|
|
1936
|
+
active: boolean;
|
|
1937
|
+
level: 'LIGHT' | 'MODERATE' | 'SEVERE';
|
|
1938
|
+
reason: string;
|
|
1939
|
+
activated_at: number | null;
|
|
1940
|
+
auto_recover_at: number | null;
|
|
1941
|
+
}
|
|
1942
|
+
interface SystemState {
|
|
1943
|
+
kill_switch: KillSwitchState;
|
|
1944
|
+
degrade: DegradeState;
|
|
1945
|
+
tightened_threshold_multiplier: number;
|
|
1946
|
+
force_human_gate: boolean;
|
|
1947
|
+
}
|
|
1948
|
+
declare class TrendAlertEngine {
|
|
1949
|
+
private thresholds;
|
|
1950
|
+
private alertHistory;
|
|
1951
|
+
private lastAlertTime;
|
|
1952
|
+
private systemState;
|
|
1953
|
+
private metricsBuffer;
|
|
1954
|
+
constructor(customThresholds?: AlertThreshold[]);
|
|
1955
|
+
evaluate(metrics: TrendMetric[], tenantId?: string): AlertEvent[];
|
|
1956
|
+
cronEvaluate(getMetrics: () => TrendMetric[], tenantId?: string): {
|
|
1957
|
+
alerts: AlertEvent[];
|
|
1958
|
+
state: SystemState;
|
|
1959
|
+
};
|
|
1960
|
+
private executeProtectiveAction;
|
|
1961
|
+
private activateDegrade;
|
|
1962
|
+
private tightenThreshold;
|
|
1963
|
+
private activateKillSwitch;
|
|
1964
|
+
private checkThreshold;
|
|
1965
|
+
private checkAutoRecover;
|
|
1966
|
+
acknowledgeAlert(alertId: string, acknowledgedBy: string): boolean;
|
|
1967
|
+
disableKillSwitch(reason: string, actor: string): boolean;
|
|
1968
|
+
resetDegrade(): void;
|
|
1969
|
+
getSystemState(): SystemState;
|
|
1970
|
+
getAlertHistory(limit?: number): AlertEvent[];
|
|
1971
|
+
getActiveAlerts(): AlertEvent[];
|
|
1972
|
+
getMetricsBuffer(): TrendMetric[];
|
|
1973
|
+
private formatAlertMessage;
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1976
|
+
/**
|
|
1977
|
+
* selfConstraintEngine.ts — 自我约束机制引擎
|
|
1978
|
+
*
|
|
1979
|
+
* 覆盖 PDF10: 人工智能痛点自我约束机制实施计划
|
|
1980
|
+
*
|
|
1981
|
+
* 核心能力:
|
|
1982
|
+
* - 风险密度监测: 持续跟踪风险密度指标
|
|
1983
|
+
* - 规则冲突率监测: 检测规则之间的冲突
|
|
1984
|
+
* - 决策置信度监测: 跟踪决策置信度下降趋势
|
|
1985
|
+
* - Auto Tightening Thresholds: 自动收紧阈值
|
|
1986
|
+
* - Capability Downgrade Flags: 功能降级标志
|
|
1987
|
+
* - Forced Human Gate: 强制人工门禁
|
|
1988
|
+
* - tightening_thresholds 配置: 可配置化阈值策略
|
|
1989
|
+
* - capability_flags 配置: 功能开关控制
|
|
1990
|
+
*
|
|
1991
|
+
* 三种退让模式:
|
|
1992
|
+
* 1. 降低能力 — 自动缩小可执行操作范围
|
|
1993
|
+
* 2. 降低速度 — 延后决策等待更多证据
|
|
1994
|
+
* 3. 降低权限 — 交由人工介入
|
|
1995
|
+
*/
|
|
1996
|
+
type ConstraintMode = 'CAPABILITY_DOWN' | 'SPEED_DOWN' | 'PERMISSION_DOWN';
|
|
1997
|
+
type ConstraintLevel = 'NORMAL' | 'CAUTIOUS' | 'RESTRICTED' | 'LOCKDOWN';
|
|
1998
|
+
interface TighteningThresholds {
|
|
1999
|
+
risk_density: number;
|
|
2000
|
+
conflict_rate: number;
|
|
2001
|
+
confidence_drop: number;
|
|
2002
|
+
error_rate: number;
|
|
2003
|
+
latency_p99_ms: number;
|
|
2004
|
+
consecutive_failures: number;
|
|
2005
|
+
}
|
|
2006
|
+
interface CapabilityFlags {
|
|
2007
|
+
enable_advanced_features: boolean;
|
|
2008
|
+
enable_auto_approve: boolean;
|
|
2009
|
+
enable_batch_operations: boolean;
|
|
2010
|
+
enable_external_api_calls: boolean;
|
|
2011
|
+
enable_write_operations: boolean;
|
|
2012
|
+
require_human_gate: boolean;
|
|
2013
|
+
require_dual_review: boolean;
|
|
2014
|
+
max_concurrent_decisions: number;
|
|
2015
|
+
decision_delay_ms: number;
|
|
2016
|
+
}
|
|
2017
|
+
interface ConstraintConfig {
|
|
2018
|
+
thresholds: TighteningThresholds;
|
|
2019
|
+
flags: CapabilityFlags;
|
|
2020
|
+
auto_recover_after_minutes: number;
|
|
2021
|
+
evaluation_interval_seconds: number;
|
|
2022
|
+
}
|
|
2023
|
+
interface MonitoringMetrics {
|
|
2024
|
+
risk_density: number;
|
|
2025
|
+
conflict_rate: number;
|
|
2026
|
+
avg_confidence: number;
|
|
2027
|
+
prev_avg_confidence: number;
|
|
2028
|
+
error_rate: number;
|
|
2029
|
+
latency_p99_ms: number;
|
|
2030
|
+
consecutive_failures: number;
|
|
2031
|
+
pending_approval_count: number;
|
|
2032
|
+
system_pressure: number;
|
|
2033
|
+
}
|
|
2034
|
+
interface ConstraintDecision {
|
|
2035
|
+
decision_id: string;
|
|
2036
|
+
timestamp: number;
|
|
2037
|
+
level: ConstraintLevel;
|
|
2038
|
+
modes_activated: ConstraintMode[];
|
|
2039
|
+
triggers: ConstraintTrigger[];
|
|
2040
|
+
flags_applied: Partial<CapabilityFlags>;
|
|
2041
|
+
reason_code: string;
|
|
2042
|
+
auto_recover_at: number | null;
|
|
2043
|
+
}
|
|
2044
|
+
interface ConstraintTrigger {
|
|
2045
|
+
metric_name: string;
|
|
2046
|
+
current_value: number;
|
|
2047
|
+
threshold_value: number;
|
|
2048
|
+
exceeded: boolean;
|
|
2049
|
+
}
|
|
2050
|
+
interface ConstraintState {
|
|
2051
|
+
current_level: ConstraintLevel;
|
|
2052
|
+
active_modes: ConstraintMode[];
|
|
2053
|
+
flags: CapabilityFlags;
|
|
2054
|
+
activated_at: number | null;
|
|
2055
|
+
auto_recover_at: number | null;
|
|
2056
|
+
last_evaluation_at: number;
|
|
2057
|
+
evaluation_count: number;
|
|
2058
|
+
constraint_history: ConstraintDecision[];
|
|
2059
|
+
}
|
|
2060
|
+
declare class SelfConstraintEngine {
|
|
2061
|
+
private config;
|
|
2062
|
+
private state;
|
|
2063
|
+
constructor(config?: Partial<ConstraintConfig>);
|
|
2064
|
+
evaluate(metrics: MonitoringMetrics): ConstraintDecision;
|
|
2065
|
+
private calculateLevel;
|
|
2066
|
+
private applyConstraint;
|
|
2067
|
+
checkAutoRecover(): boolean;
|
|
2068
|
+
reset(): void;
|
|
2069
|
+
forceLevel(level: ConstraintLevel): void;
|
|
2070
|
+
preDecisionCheck(action: string, resource: string): {
|
|
2071
|
+
allowed: boolean;
|
|
2072
|
+
delay_ms: number;
|
|
2073
|
+
requires_human: boolean;
|
|
2074
|
+
requires_dual_review: boolean;
|
|
2075
|
+
reason: string;
|
|
2076
|
+
};
|
|
2077
|
+
getState(): ConstraintState;
|
|
2078
|
+
getCurrentLevel(): ConstraintLevel;
|
|
2079
|
+
getFlags(): CapabilityFlags;
|
|
2080
|
+
isConstrained(): boolean;
|
|
2081
|
+
private isWriteAction;
|
|
2082
|
+
private isExternalAction;
|
|
2083
|
+
private isBatchAction;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
/**
|
|
2087
|
+
* contributionSettlement.ts — 贡献结算引擎
|
|
2088
|
+
*
|
|
2089
|
+
* 覆盖 PDF3: 人工智能痛点上下文总结(3) — 激励对齐方案
|
|
2090
|
+
*
|
|
2091
|
+
* 核心能力:
|
|
2092
|
+
* - 四维贡献打分: Risk / Cost / Human / Stability
|
|
2093
|
+
* - 归因引擎: 对 rule/model/tool/agent/human/system 各参与者计分
|
|
2094
|
+
* - 窗口聚合: 按时间窗口聚合贡献事件为分数
|
|
2095
|
+
* - 反作弊机制: 硬性门槛 + 惩罚机制 + 审计抽查
|
|
2096
|
+
* - 评分公式: Score_total = w_R*Score_risk + w_C*Score_cost + w_H*Score_human + w_S*Score_stability - Penalties
|
|
2097
|
+
* - 与控制面联动: 贡献分数→权限/资源分配
|
|
2098
|
+
*/
|
|
2099
|
+
type ContributionDimension = 'RISK' | 'COST' | 'HUMAN' | 'STABILITY';
|
|
2100
|
+
type EntityType = 'rule' | 'model' | 'tool' | 'agent' | 'human' | 'system';
|
|
2101
|
+
interface ContributionEvent {
|
|
2102
|
+
event_id: string;
|
|
2103
|
+
trace_id: string;
|
|
2104
|
+
decision_id: string;
|
|
2105
|
+
tenant_id: string;
|
|
2106
|
+
entity_type: EntityType;
|
|
2107
|
+
entity_id: string;
|
|
2108
|
+
dimension: ContributionDimension;
|
|
2109
|
+
delta_value: number;
|
|
2110
|
+
delta_confidence: number;
|
|
2111
|
+
baseline_ref: string;
|
|
2112
|
+
evidence_bundle_hash: string;
|
|
2113
|
+
created_at: number;
|
|
2114
|
+
}
|
|
2115
|
+
interface ContributionScore {
|
|
2116
|
+
score_id: string;
|
|
2117
|
+
window_start: number;
|
|
2118
|
+
window_end: number;
|
|
2119
|
+
tenant_id: string;
|
|
2120
|
+
entity_type: EntityType;
|
|
2121
|
+
entity_id: string;
|
|
2122
|
+
score_risk: number;
|
|
2123
|
+
score_cost: number;
|
|
2124
|
+
score_human: number;
|
|
2125
|
+
score_stability: number;
|
|
2126
|
+
score_total: number;
|
|
2127
|
+
penalty_total: number;
|
|
2128
|
+
confidence: number;
|
|
2129
|
+
score_config_version: string;
|
|
2130
|
+
created_at: number;
|
|
2131
|
+
}
|
|
2132
|
+
interface ScoreConfigVersion {
|
|
2133
|
+
version: string;
|
|
2134
|
+
weight_risk: number;
|
|
2135
|
+
weight_cost: number;
|
|
2136
|
+
weight_human: number;
|
|
2137
|
+
weight_stability: number;
|
|
2138
|
+
weight_penalty: number;
|
|
2139
|
+
caps: {
|
|
2140
|
+
max_single_event: number;
|
|
2141
|
+
max_risk_positive_when_risk_up: boolean;
|
|
2142
|
+
};
|
|
2143
|
+
guardrails: string[];
|
|
2144
|
+
approved_by: string;
|
|
2145
|
+
approved_at: number;
|
|
2146
|
+
}
|
|
2147
|
+
interface AttributionRule {
|
|
2148
|
+
condition: string;
|
|
2149
|
+
target_entity_type: EntityType;
|
|
2150
|
+
target_entity_field: string;
|
|
2151
|
+
weight: number;
|
|
2152
|
+
}
|
|
2153
|
+
interface PenaltyCheck {
|
|
2154
|
+
name: string;
|
|
2155
|
+
detect: (events: ContributionEvent[], context: SettlementContext) => number;
|
|
2156
|
+
}
|
|
2157
|
+
interface SettlementContext {
|
|
2158
|
+
tenant_id: string;
|
|
2159
|
+
window_start: number;
|
|
2160
|
+
window_end: number;
|
|
2161
|
+
override_count_delta: number;
|
|
2162
|
+
replay_fail_delta: number;
|
|
2163
|
+
risk_regression: boolean;
|
|
2164
|
+
evidence_downgrade: boolean;
|
|
2165
|
+
}
|
|
2166
|
+
declare class ContributionSettlementEngine {
|
|
2167
|
+
private config;
|
|
2168
|
+
private attributionRules;
|
|
2169
|
+
private penaltyChecks;
|
|
2170
|
+
private eventStore;
|
|
2171
|
+
private scoreStore;
|
|
2172
|
+
constructor(config?: Partial<ScoreConfigVersion>, customRules?: AttributionRule[], customPenalties?: PenaltyCheck[]);
|
|
2173
|
+
recordEvent(event: ContributionEvent): ContributionEvent;
|
|
2174
|
+
attribute(traceId: string, condition: string, entityType: EntityType, entityId: string): ContributionEvent | null;
|
|
2175
|
+
settle(context: SettlementContext): ContributionScore[];
|
|
2176
|
+
getResourceAllocation(entityType: EntityType, entityId: string): {
|
|
2177
|
+
token_budget_multiplier: number;
|
|
2178
|
+
concurrency_quota_multiplier: number;
|
|
2179
|
+
auto_approve_eligible: boolean;
|
|
2180
|
+
requires_dual_review: boolean;
|
|
2181
|
+
};
|
|
2182
|
+
auditSample(entityType: EntityType, entityId: string, sampleSize?: number): ContributionEvent[];
|
|
2183
|
+
private inferDimension;
|
|
2184
|
+
getConfig(): ScoreConfigVersion;
|
|
2185
|
+
getEventCount(): number;
|
|
2186
|
+
getScoreCount(): number;
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
/**
|
|
2190
|
+
* overrideDriftAnalyzer.ts — Override 漂移分析器
|
|
2191
|
+
*
|
|
2192
|
+
* 覆盖 PDF1/2: 对抗防护闭环 — Override Drift 检测
|
|
2193
|
+
*
|
|
2194
|
+
* 核心能力:
|
|
2195
|
+
* - 周期统计: 按时间窗口统计 override 频率/分布
|
|
2196
|
+
* - drift_index 计算: 量化 override 偏离基线的程度
|
|
2197
|
+
* - 告警生成: 当 drift_index 超过阈值时触发告警
|
|
2198
|
+
* - 模式识别: 识别 override 的时间/用户/规则模式
|
|
2199
|
+
* - 与 trendAlertEngine / selfConstraintEngine 联动
|
|
2200
|
+
*/
|
|
2201
|
+
interface OverrideEvent {
|
|
2202
|
+
event_id: string;
|
|
2203
|
+
decision_id: string;
|
|
2204
|
+
trace_id: string;
|
|
2205
|
+
tenant_id: string;
|
|
2206
|
+
actor_id: string;
|
|
2207
|
+
actor_type: 'human' | 'agent' | 'system';
|
|
2208
|
+
rule_id: string;
|
|
2209
|
+
original_outcome: 'BLOCK' | 'WARN';
|
|
2210
|
+
override_outcome: 'ALLOW';
|
|
2211
|
+
override_reason: string;
|
|
2212
|
+
risk_level: 'LOW' | 'MEDIUM' | 'HIGH' | 'CRITICAL';
|
|
2213
|
+
created_at: number;
|
|
2214
|
+
}
|
|
2215
|
+
interface DriftWindow {
|
|
2216
|
+
window_start: number;
|
|
2217
|
+
window_end: number;
|
|
2218
|
+
total_decisions: number;
|
|
2219
|
+
total_overrides: number;
|
|
2220
|
+
override_rate: number;
|
|
2221
|
+
by_actor: Map<string, number>;
|
|
2222
|
+
by_rule: Map<string, number>;
|
|
2223
|
+
by_risk_level: Record<string, number>;
|
|
2224
|
+
by_hour: number[];
|
|
2225
|
+
}
|
|
2226
|
+
interface DriftIndex {
|
|
2227
|
+
value: number;
|
|
2228
|
+
rate_drift: number;
|
|
2229
|
+
concentration_drift: number;
|
|
2230
|
+
risk_drift: number;
|
|
2231
|
+
temporal_drift: number;
|
|
2232
|
+
trend: 'STABLE' | 'RISING' | 'FALLING' | 'VOLATILE';
|
|
2233
|
+
}
|
|
2234
|
+
interface DriftAlert {
|
|
2235
|
+
alert_id: string;
|
|
2236
|
+
drift_index: DriftIndex;
|
|
2237
|
+
severity: 'INFO' | 'WARN' | 'CRITICAL';
|
|
2238
|
+
message: string;
|
|
2239
|
+
patterns_detected: DriftPattern[];
|
|
2240
|
+
recommendations: string[];
|
|
2241
|
+
created_at: number;
|
|
2242
|
+
}
|
|
2243
|
+
interface DriftPattern {
|
|
2244
|
+
pattern_type: 'ACTOR_CONCENTRATION' | 'RULE_BYPASS' | 'TIME_ANOMALY' | 'RISK_ESCALATION' | 'RATE_SPIKE';
|
|
2245
|
+
description: string;
|
|
2246
|
+
evidence: Record<string, unknown>;
|
|
2247
|
+
confidence: number;
|
|
2248
|
+
}
|
|
2249
|
+
interface DriftAnalyzerConfig {
|
|
2250
|
+
baseline_window_hours: number;
|
|
2251
|
+
analysis_window_hours: number;
|
|
2252
|
+
rate_drift_threshold: number;
|
|
2253
|
+
concentration_threshold: number;
|
|
2254
|
+
risk_drift_threshold: number;
|
|
2255
|
+
temporal_drift_threshold: number;
|
|
2256
|
+
composite_alert_threshold: number;
|
|
2257
|
+
min_sample_size: number;
|
|
2258
|
+
}
|
|
2259
|
+
declare class OverrideDriftAnalyzer {
|
|
2260
|
+
private config;
|
|
2261
|
+
private events;
|
|
2262
|
+
private baselineWindow;
|
|
2263
|
+
private alerts;
|
|
2264
|
+
constructor(config?: Partial<DriftAnalyzerConfig>);
|
|
2265
|
+
recordOverride(event: OverrideEvent): void;
|
|
2266
|
+
computeWindow(start: number, end: number, totalDecisions?: number): DriftWindow;
|
|
2267
|
+
updateBaseline(totalDecisions?: number): DriftWindow;
|
|
2268
|
+
calculateDriftIndex(currentWindow?: DriftWindow, totalDecisions?: number): DriftIndex;
|
|
2269
|
+
analyze(totalDecisions?: number): DriftAlert | null;
|
|
2270
|
+
private detectPatterns;
|
|
2271
|
+
private generateRecommendations;
|
|
2272
|
+
private calculateConcentration;
|
|
2273
|
+
private calculateTemporalDrift;
|
|
2274
|
+
private determineTrend;
|
|
2275
|
+
getAlerts(limit?: number): DriftAlert[];
|
|
2276
|
+
getEventCount(): number;
|
|
2277
|
+
getLatestDriftIndex(totalDecisions?: number): DriftIndex;
|
|
2278
|
+
getStats(): {
|
|
2279
|
+
total_events: number;
|
|
2280
|
+
total_alerts: number;
|
|
2281
|
+
baseline_override_rate: number;
|
|
2282
|
+
current_override_rate: number;
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
|
|
1873
2286
|
/**
|
|
1874
2287
|
* @sovr/engine — Unified Policy Engine
|
|
1875
2288
|
*
|
|
@@ -2086,4 +2499,4 @@ declare class PolicyEngine {
|
|
|
2086
2499
|
}): void;
|
|
2087
2500
|
}
|
|
2088
2501
|
|
|
2089
|
-
export { type ABTestConfig, AdaptiveThresholdManager, type AdaptiveThresholdOptions, type AdjustmentResult, type AggregateSnapshot, type AggregationResult, type AggregationType, type AggregationWindow, type AssembledContext, type AuditEvent, AutoHardenEngine, type BudgetAlert, type BudgetLevel, type BudgetNode, type CacheEntry, type Channel, type CircuitBreakerState, type CircuitState, type ComparableInput, type ComparableResult, type ComparisonNode, type CompiledExpression, type ConsistencyMismatch, type ConsistencyResult, ContextAccelerator, type ContextAcceleratorConfig, type ContextFragment, type ContextPriority, type CostAuditEvent, type CostCategory, type CostEstimate, type CostEstimateRequest, type CostGateEnhancedConfig, CostGateEnhancedEngine, type CostRecord, type CostReport, type CostSummary, type DCFInput, type DCFResult, DEFAULT_CA_CONFIG, DEFAULT_GE_CONFIG, DEFAULT_HARD_RULES, DEFAULT_RULES, DEFAULT_SCORING_WEIGHTS, DEFAULT_TSA_CONFIG, type DataPoint, type DecisionFeedback, type DegradationLevel, type DriftConfig, type DriftResult, type EligibilityResult, type EngineConfig, type EngineTier, type EngineTierLimits, type EstimateAccuracy, type EvalContext, type EvalRequest, type EvalResult, EvolutionChannelEngine, type EvolutionConfig, type EvolutionEvent, type ExecContext, type ExprTreePolicyRule, type ExpressionNode, type FeatureSwitchDef, type FeatureSwitchState, FeatureSwitchesManager, type FeatureSwitchesOptions, type FunctionNode, type PolicyVersion as GovPolicyVersion, type GovernanceDecision, GovernanceEnhancer, type GovernanceEnhancerConfig, type GovernanceRule, type HardRule, type HardenConfig, type HardenEvent, type HardenLevel, type HardenMeasure, type HardenMeasureType, type HardenState, type HttpContext, type LiteralNode, type LogicalNode, type MarketSize, type McpContext, type ModelCandidate, type ModelPricing, type ModelTier, type MultiLevelBudgetConfig, MultiLevelBudgetEngine, type NetworkEffectInput, type NetworkEffectResult, type NotNode, PolicyEngine, type PolicyRule, type PolicySnapshot, type PolicyVersion$1 as PolicyVersion, type PrefetchRule, type PricingEvalRequest, type PricingEvalResult, type PricingRule, PricingRulesEngine, type ReasonCode, type RecalcEngineConfig, type RecalcGranularity, type RecalcHandler, type RecalcTask, type RecalcTaskStatus, type RecalcTriggerType, RecalculationEngine, type RiskLevel, type RoutingDecision, type RoutingRequest, type RuleCondition, type RuleEvalResult, SOVR_FEATURE_SWITCHES, type ScoringResult, type ScoringWeights, SemanticDriftDetectorEngine, type SemanticFingerprint, type SensitivityResult, type SqlContext, type ThresholdConfig, TimeSeriesAggregator, type TimeSeriesAggregatorConfig, type ToolPricing, TwoPhaseRouter, type TwoPhaseRouterConfig, type UnitEconomics, ValuationModel, type ValuationModelConfig, type VariableNode, type Verdict, type WindowType, compileFromJSON, compileRuleSet, createAutoHardenEngine, createCostGateEnhanced, createEvolutionChannel, createMultiLevelBudget, createRecalculationEngine, createSemanticDriftDetector, PolicyEngine as default, estimateCost, evaluateRules, getAccuracyStats, getModelPricingTable, getToolPricingTable, recordActualCost, registerFunction, updateModelPricing, updateToolPricing };
|
|
2502
|
+
export { type ABTestConfig, AdaptiveThresholdManager, type AdaptiveThresholdOptions, type AdjustmentResult, type AggregateSnapshot, type AggregationResult, type AggregationType, type AggregationWindow, type AlertEvent, type AlertSeverity, type AlertThreshold, type AlertType, type AssembledContext, type AttributionRule, type AuditEvent, AutoHardenEngine, type BudgetAlert, type BudgetLevel, type BudgetNode, type CacheEntry, type CapabilityFlags, type Channel, type CircuitBreakerState, type CircuitState, type ComparableInput, type ComparableResult, type ComparisonNode, type CompiledExpression, type ConsistencyMismatch, type ConsistencyResult, type ConstraintConfig, type ConstraintDecision, type ConstraintLevel, type ConstraintMode, type ConstraintState, type ConstraintTrigger, ContextAccelerator, type ContextAcceleratorConfig, type ContextFragment, type ContextPriority, type ContributionDimension, type ContributionEvent, type ContributionScore, ContributionSettlementEngine, type CostAuditEvent, type CostCategory, type CostEstimate, type CostEstimateRequest, type CostGateEnhancedConfig, CostGateEnhancedEngine, type CostRecord, type CostReport, type CostSummary, type DCFInput, type DCFResult, DEFAULT_CA_CONFIG, DEFAULT_GE_CONFIG, DEFAULT_HARD_RULES, DEFAULT_RULES, DEFAULT_SCORING_WEIGHTS, DEFAULT_TSA_CONFIG, type DataPoint, type DecisionFeedback, type DegradationLevel, type DegradeState, type DriftAlert, type DriftAnalyzerConfig, type DriftConfig, type DriftIndex, type DriftPattern, type DriftResult, type DriftWindow, type EligibilityResult, type EngineConfig, type EngineTier, type EngineTierLimits, type EntityType, type EstimateAccuracy, type EvalContext, type EvalRequest, type EvalResult, EvolutionChannelEngine, type EvolutionConfig, type EvolutionEvent, type ExecContext, type ExprTreePolicyRule, type ExpressionNode, type FeatureSwitchDef, type FeatureSwitchState, FeatureSwitchesManager, type FeatureSwitchesOptions, type FunctionNode, type PolicyVersion as GovPolicyVersion, type GovernanceDecision, GovernanceEnhancer, type GovernanceEnhancerConfig, type GovernanceRule, type HardRule, type HardenConfig, type HardenEvent, type HardenLevel, type HardenMeasure, type HardenMeasureType, type HardenState, type HttpContext, type KillSwitchState, type LiteralNode, type LogicalNode, type MarketSize, type McpContext, type ModelCandidate, type ModelPricing, type ModelTier, type MonitoringMetrics, type MultiLevelBudgetConfig, MultiLevelBudgetEngine, type NetworkEffectInput, type NetworkEffectResult, type NotNode, OverrideDriftAnalyzer, type OverrideEvent, type PenaltyCheck, PolicyEngine, type PolicyRule, type PolicySnapshot, type PolicyVersion$1 as PolicyVersion, type PrefetchRule, type PricingEvalRequest, type PricingEvalResult, type PricingRule, PricingRulesEngine, type ProtectiveAction, type ReasonCode, type RecalcEngineConfig, type RecalcGranularity, type RecalcHandler, type RecalcTask, type RecalcTaskStatus, type RecalcTriggerType, RecalculationEngine, type RiskLevel, type RoutingDecision, type RoutingRequest, type RuleCondition, type RuleEvalResult, SOVR_FEATURE_SWITCHES, type ScoreConfigVersion, type ScoringResult, type ScoringWeights, SelfConstraintEngine, SemanticDriftDetectorEngine, type SemanticFingerprint, type SensitivityResult, type SettlementContext, type SqlContext, type SystemState, type ThresholdConfig, type TighteningThresholds, TimeSeriesAggregator, type TimeSeriesAggregatorConfig, type ToolPricing, TrendAlertEngine, type TrendMetric, TwoPhaseRouter, type TwoPhaseRouterConfig, type UnitEconomics, ValuationModel, type ValuationModelConfig, type VariableNode, type Verdict, type WindowType, compileFromJSON, compileRuleSet, createAutoHardenEngine, createCostGateEnhanced, createEvolutionChannel, createMultiLevelBudget, createRecalculationEngine, createSemanticDriftDetector, PolicyEngine as default, estimateCost, evaluateRules, getAccuracyStats, getModelPricingTable, getToolPricingTable, recordActualCost, registerFunction, updateModelPricing, updateToolPricing };
|