@vorionsys/contracts 0.1.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.
Files changed (173) hide show
  1. package/dist/aci/aci-string.d.ts +539 -0
  2. package/dist/aci/aci-string.d.ts.map +1 -0
  3. package/dist/aci/aci-string.js +563 -0
  4. package/dist/aci/aci-string.js.map +1 -0
  5. package/dist/aci/attestation.d.ts +648 -0
  6. package/dist/aci/attestation.d.ts.map +1 -0
  7. package/dist/aci/attestation.js +289 -0
  8. package/dist/aci/attestation.js.map +1 -0
  9. package/dist/aci/domains.d.ts +260 -0
  10. package/dist/aci/domains.d.ts.map +1 -0
  11. package/dist/aci/domains.js +322 -0
  12. package/dist/aci/domains.js.map +1 -0
  13. package/dist/aci/effective-permission.d.ts +371 -0
  14. package/dist/aci/effective-permission.d.ts.map +1 -0
  15. package/dist/aci/effective-permission.js +351 -0
  16. package/dist/aci/effective-permission.js.map +1 -0
  17. package/dist/aci/identity.d.ts +1100 -0
  18. package/dist/aci/identity.d.ts.map +1 -0
  19. package/dist/aci/identity.js +328 -0
  20. package/dist/aci/identity.js.map +1 -0
  21. package/dist/aci/index.d.ts +67 -0
  22. package/dist/aci/index.d.ts.map +1 -0
  23. package/dist/aci/index.js +157 -0
  24. package/dist/aci/index.js.map +1 -0
  25. package/dist/aci/jwt-claims.d.ts +756 -0
  26. package/dist/aci/jwt-claims.d.ts.map +1 -0
  27. package/dist/aci/jwt-claims.js +335 -0
  28. package/dist/aci/jwt-claims.js.map +1 -0
  29. package/dist/aci/levels.d.ts +279 -0
  30. package/dist/aci/levels.d.ts.map +1 -0
  31. package/dist/aci/levels.js +467 -0
  32. package/dist/aci/levels.js.map +1 -0
  33. package/dist/aci/mapping.d.ts +291 -0
  34. package/dist/aci/mapping.d.ts.map +1 -0
  35. package/dist/aci/mapping.js +427 -0
  36. package/dist/aci/mapping.js.map +1 -0
  37. package/dist/aci/skills.d.ts +314 -0
  38. package/dist/aci/skills.d.ts.map +1 -0
  39. package/dist/aci/skills.js +404 -0
  40. package/dist/aci/skills.js.map +1 -0
  41. package/dist/aci/tiers.d.ts +403 -0
  42. package/dist/aci/tiers.d.ts.map +1 -0
  43. package/dist/aci/tiers.js +659 -0
  44. package/dist/aci/tiers.js.map +1 -0
  45. package/dist/canonical/agent.d.ts +796 -0
  46. package/dist/canonical/agent.d.ts.map +1 -0
  47. package/dist/canonical/agent.js +527 -0
  48. package/dist/canonical/agent.js.map +1 -0
  49. package/dist/canonical/governance.d.ts +905 -0
  50. package/dist/canonical/governance.d.ts.map +1 -0
  51. package/dist/canonical/governance.js +454 -0
  52. package/dist/canonical/governance.js.map +1 -0
  53. package/dist/canonical/index.d.ts +17 -0
  54. package/dist/canonical/index.d.ts.map +1 -0
  55. package/dist/canonical/index.js +21 -0
  56. package/dist/canonical/index.js.map +1 -0
  57. package/dist/canonical/intent.d.ts +727 -0
  58. package/dist/canonical/intent.d.ts.map +1 -0
  59. package/dist/canonical/intent.js +203 -0
  60. package/dist/canonical/intent.js.map +1 -0
  61. package/dist/canonical/risk-level.d.ts +344 -0
  62. package/dist/canonical/risk-level.d.ts.map +1 -0
  63. package/dist/canonical/risk-level.js +472 -0
  64. package/dist/canonical/risk-level.js.map +1 -0
  65. package/dist/canonical/trust-band.d.ts +239 -0
  66. package/dist/canonical/trust-band.d.ts.map +1 -0
  67. package/dist/canonical/trust-band.js +298 -0
  68. package/dist/canonical/trust-band.js.map +1 -0
  69. package/dist/canonical/trust-score.d.ts +301 -0
  70. package/dist/canonical/trust-score.d.ts.map +1 -0
  71. package/dist/canonical/trust-score.js +390 -0
  72. package/dist/canonical/trust-score.js.map +1 -0
  73. package/dist/canonical/trust-signal.d.ts +617 -0
  74. package/dist/canonical/trust-signal.d.ts.map +1 -0
  75. package/dist/canonical/trust-signal.js +355 -0
  76. package/dist/canonical/trust-signal.js.map +1 -0
  77. package/dist/canonical/validation.d.ts +231 -0
  78. package/dist/canonical/validation.d.ts.map +1 -0
  79. package/dist/canonical/validation.js +558 -0
  80. package/dist/canonical/validation.js.map +1 -0
  81. package/dist/common/index.d.ts +7 -0
  82. package/dist/common/index.d.ts.map +1 -0
  83. package/dist/common/index.js +7 -0
  84. package/dist/common/index.js.map +1 -0
  85. package/dist/common/primitives.d.ts +56 -0
  86. package/dist/common/primitives.d.ts.map +1 -0
  87. package/dist/common/primitives.js +70 -0
  88. package/dist/common/primitives.js.map +1 -0
  89. package/dist/index.d.ts +11 -0
  90. package/dist/index.d.ts.map +1 -0
  91. package/dist/index.js +15 -0
  92. package/dist/index.js.map +1 -0
  93. package/dist/v2/canary-probe.d.ts +201 -0
  94. package/dist/v2/canary-probe.d.ts.map +1 -0
  95. package/dist/v2/canary-probe.js +99 -0
  96. package/dist/v2/canary-probe.js.map +1 -0
  97. package/dist/v2/component.d.ts +132 -0
  98. package/dist/v2/component.d.ts.map +1 -0
  99. package/dist/v2/component.js +5 -0
  100. package/dist/v2/component.js.map +1 -0
  101. package/dist/v2/decision.d.ts +310 -0
  102. package/dist/v2/decision.d.ts.map +1 -0
  103. package/dist/v2/decision.js +21 -0
  104. package/dist/v2/decision.js.map +1 -0
  105. package/dist/v2/enums.d.ts +185 -0
  106. package/dist/v2/enums.d.ts.map +1 -0
  107. package/dist/v2/enums.js +203 -0
  108. package/dist/v2/enums.js.map +1 -0
  109. package/dist/v2/evidence.d.ts +368 -0
  110. package/dist/v2/evidence.d.ts.map +1 -0
  111. package/dist/v2/evidence.js +152 -0
  112. package/dist/v2/evidence.js.map +1 -0
  113. package/dist/v2/execution.d.ts +190 -0
  114. package/dist/v2/execution.d.ts.map +1 -0
  115. package/dist/v2/execution.js +5 -0
  116. package/dist/v2/execution.js.map +1 -0
  117. package/dist/v2/index.d.ts +19 -0
  118. package/dist/v2/index.d.ts.map +1 -0
  119. package/dist/v2/index.js +32 -0
  120. package/dist/v2/index.js.map +1 -0
  121. package/dist/v2/intent.d.ts +89 -0
  122. package/dist/v2/intent.d.ts.map +1 -0
  123. package/dist/v2/intent.js +5 -0
  124. package/dist/v2/intent.js.map +1 -0
  125. package/dist/v2/policy-bundle.d.ts +166 -0
  126. package/dist/v2/policy-bundle.d.ts.map +1 -0
  127. package/dist/v2/policy-bundle.js +20 -0
  128. package/dist/v2/policy-bundle.js.map +1 -0
  129. package/dist/v2/pre-action-gate.d.ts +185 -0
  130. package/dist/v2/pre-action-gate.d.ts.map +1 -0
  131. package/dist/v2/pre-action-gate.js +64 -0
  132. package/dist/v2/pre-action-gate.js.map +1 -0
  133. package/dist/v2/proof-event.d.ts +201 -0
  134. package/dist/v2/proof-event.d.ts.map +1 -0
  135. package/dist/v2/proof-event.js +5 -0
  136. package/dist/v2/proof-event.js.map +1 -0
  137. package/dist/v2/retention.d.ts +329 -0
  138. package/dist/v2/retention.d.ts.map +1 -0
  139. package/dist/v2/retention.js +162 -0
  140. package/dist/v2/retention.js.map +1 -0
  141. package/dist/v2/trust-delta.d.ts +119 -0
  142. package/dist/v2/trust-delta.d.ts.map +1 -0
  143. package/dist/v2/trust-delta.js +28 -0
  144. package/dist/v2/trust-delta.js.map +1 -0
  145. package/dist/v2/trust-profile.d.ts +337 -0
  146. package/dist/v2/trust-profile.d.ts.map +1 -0
  147. package/dist/v2/trust-profile.js +96 -0
  148. package/dist/v2/trust-profile.js.map +1 -0
  149. package/dist/validators/decision.d.ts +430 -0
  150. package/dist/validators/decision.d.ts.map +1 -0
  151. package/dist/validators/decision.js +61 -0
  152. package/dist/validators/decision.js.map +1 -0
  153. package/dist/validators/enums.d.ts +24 -0
  154. package/dist/validators/enums.d.ts.map +1 -0
  155. package/dist/validators/enums.js +24 -0
  156. package/dist/validators/enums.js.map +1 -0
  157. package/dist/validators/index.d.ts +30 -0
  158. package/dist/validators/index.d.ts.map +1 -0
  159. package/dist/validators/index.js +42 -0
  160. package/dist/validators/index.js.map +1 -0
  161. package/dist/validators/intent.d.ts +229 -0
  162. package/dist/validators/intent.d.ts.map +1 -0
  163. package/dist/validators/intent.js +47 -0
  164. package/dist/validators/intent.js.map +1 -0
  165. package/dist/validators/proof-event.d.ts +981 -0
  166. package/dist/validators/proof-event.d.ts.map +1 -0
  167. package/dist/validators/proof-event.js +134 -0
  168. package/dist/validators/proof-event.js.map +1 -0
  169. package/dist/validators/trust-profile.d.ts +350 -0
  170. package/dist/validators/trust-profile.d.ts.map +1 -0
  171. package/dist/validators/trust-profile.js +65 -0
  172. package/dist/validators/trust-profile.js.map +1 -0
  173. package/package.json +65 -0
@@ -0,0 +1,337 @@
1
+ /**
2
+ * Trust Profile types - represents an agent's current trust state
3
+ */
4
+ import type { ObservationTier, TrustBand } from './enums.js';
5
+ /**
6
+ * The five trust dimensions used to calculate composite trust
7
+ *
8
+ * Each dimension is scored 0-1000 where:
9
+ * - 0: No trust / evidence of failure
10
+ * - 500: Neutral / unproven
11
+ * - 1000: Maximum trust / proven excellence
12
+ *
13
+ * Note: The 0-1000 scale provides higher precision for trust calculations
14
+ * and aligns with API response formats.
15
+ */
16
+ export interface TrustDimensions {
17
+ /** Capability Trust - Does the agent have the skills? (0-1000) */
18
+ CT: number;
19
+ /** Behavioral Trust - Has the agent acted reliably? (0-1000) */
20
+ BT: number;
21
+ /** Governance Trust - Is the agent properly governed? (0-1000) */
22
+ GT: number;
23
+ /** Contextual Trust - Is this the right context for the agent? (0-1000) */
24
+ XT: number;
25
+ /** Assurance Confidence - How confident are we in our assessment? (0-1000) */
26
+ AC: number;
27
+ }
28
+ /**
29
+ * Configurable weights for trust dimensions
30
+ * All weights must sum to 1.0
31
+ */
32
+ export interface TrustWeights {
33
+ CT: number;
34
+ BT: number;
35
+ GT: number;
36
+ XT: number;
37
+ AC: number;
38
+ }
39
+ /** Default trust dimension weights */
40
+ export declare const DEFAULT_TRUST_WEIGHTS: TrustWeights;
41
+ /**
42
+ * Evidence type classification for weighted trust calculations
43
+ *
44
+ * HITL evidence is weighted more heavily to solve the cold-start problem:
45
+ * - A single HITL approval counts as much as ~10 automated observations
46
+ * - This allows agents to graduate faster with human oversight
47
+ */
48
+ export type EvidenceType = 'automated' | 'hitl_approval' | 'hitl_rejection' | 'examination' | 'audit' | 'sandbox_test' | 'peer_review';
49
+ /**
50
+ * Default evidence type multipliers
51
+ *
52
+ * These multipliers solve the 1000-event cold-start problem by giving
53
+ * HITL approvals significantly more weight than automated observations.
54
+ */
55
+ export declare const EVIDENCE_TYPE_MULTIPLIERS: Record<EvidenceType, number>;
56
+ /**
57
+ * Evidence item used to calculate trust dimensions
58
+ */
59
+ export interface TrustEvidence {
60
+ /** Unique identifier for this evidence */
61
+ evidenceId: string;
62
+ /** Which dimension this evidence affects */
63
+ dimension: keyof TrustDimensions;
64
+ /** Score impact (-1000 to +1000) on the 0-1000 scale */
65
+ impact: number;
66
+ /** Human-readable source of evidence */
67
+ source: string;
68
+ /** When this evidence was collected */
69
+ collectedAt: Date;
70
+ /** When this evidence expires (optional) */
71
+ expiresAt?: Date;
72
+ /**
73
+ * Evidence type for weighted calculations
74
+ * Defaults to 'automated' if not specified
75
+ */
76
+ evidenceType?: EvidenceType;
77
+ /** Additional context */
78
+ metadata?: Record<string, unknown>;
79
+ }
80
+ /**
81
+ * Complete trust profile for an agent
82
+ */
83
+ export interface TrustProfile {
84
+ /** Unique profile identifier */
85
+ profileId: string;
86
+ /** Agent this profile belongs to */
87
+ agentId: string;
88
+ /** Individual dimension scores (each 0-1000) */
89
+ dimensions: TrustDimensions;
90
+ /** Weights used for calculation */
91
+ weights: TrustWeights;
92
+ /** Raw composite score (weighted sum of dimensions, 0-1000) */
93
+ compositeScore: number;
94
+ /** Observation tier determines trust ceiling */
95
+ observationTier: ObservationTier;
96
+ /** Score after applying observation ceiling (0-1000) */
97
+ adjustedScore: number;
98
+ /** Current trust band (T0-T7) */
99
+ band: TrustBand;
100
+ /** When this profile was calculated */
101
+ calculatedAt: Date;
102
+ /** When this profile expires and needs recalculation */
103
+ validUntil?: Date;
104
+ /** Evidence items used in calculation */
105
+ evidence: TrustEvidence[];
106
+ /** Version for optimistic concurrency */
107
+ version: number;
108
+ }
109
+ /**
110
+ * Summary view of a trust profile
111
+ */
112
+ export interface TrustProfileSummary {
113
+ agentId: string;
114
+ /** Raw composite score (0-1000) */
115
+ compositeScore: number;
116
+ /** Adjusted score after observation ceiling (0-1000) */
117
+ adjustedScore: number;
118
+ band: TrustBand;
119
+ observationTier: ObservationTier;
120
+ calculatedAt: Date;
121
+ }
122
+ /**
123
+ * Request to calculate trust for an agent
124
+ */
125
+ export interface TrustCalculationRequest {
126
+ agentId: string;
127
+ observationTier: ObservationTier;
128
+ evidence: TrustEvidence[];
129
+ weights?: Partial<TrustWeights>;
130
+ }
131
+ /**
132
+ * Configuration for trust band thresholds (T0-T7)
133
+ */
134
+ export interface BandThresholds {
135
+ T0: {
136
+ min: number;
137
+ max: number;
138
+ };
139
+ T1: {
140
+ min: number;
141
+ max: number;
142
+ };
143
+ T2: {
144
+ min: number;
145
+ max: number;
146
+ };
147
+ T3: {
148
+ min: number;
149
+ max: number;
150
+ };
151
+ T4: {
152
+ min: number;
153
+ max: number;
154
+ };
155
+ T5: {
156
+ min: number;
157
+ max: number;
158
+ };
159
+ T6: {
160
+ min: number;
161
+ max: number;
162
+ };
163
+ T7: {
164
+ min: number;
165
+ max: number;
166
+ };
167
+ }
168
+ /**
169
+ * Default band thresholds on 0-1000 scale
170
+ *
171
+ * These thresholds determine which TrustBand an agent falls into
172
+ * based on their adjusted trust score.
173
+ *
174
+ * 8-tier model (T0-T7):
175
+ * - T0: Sandbox (0-199)
176
+ * - T1: Observed (200-349)
177
+ * - T2: Provisional (350-499)
178
+ * - T3: Monitored (500-649)
179
+ * - T4: Standard (650-799)
180
+ * - T5: Trusted (800-875)
181
+ * - T6: Certified (876-950)
182
+ * - T7: Autonomous (951-1000)
183
+ */
184
+ export declare const DEFAULT_BAND_THRESHOLDS: BandThresholds;
185
+ /**
186
+ * Configuration for band transitions
187
+ */
188
+ export interface BandingConfig {
189
+ thresholds: BandThresholds;
190
+ /** Points buffer to prevent oscillation */
191
+ hysteresis: number;
192
+ /** Daily decay rate for stale evidence */
193
+ decayRate: number;
194
+ /** Minimum days at current band before promotion */
195
+ promotionDelay: number;
196
+ }
197
+ /** Default banding configuration */
198
+ export declare const DEFAULT_BANDING_CONFIG: BandingConfig;
199
+ /**
200
+ * Risk profile for temporal outcome tracking
201
+ * Determines how long to wait before finalizing outcome
202
+ */
203
+ export declare enum RiskProfile {
204
+ /** 5 minutes - computations, queries */
205
+ IMMEDIATE = "IMMEDIATE",
206
+ /** 4 hours - API calls */
207
+ SHORT_TERM = "SHORT_TERM",
208
+ /** 3 days - simple transactions */
209
+ MEDIUM_TERM = "MEDIUM_TERM",
210
+ /** 30 days - financial trades */
211
+ LONG_TERM = "LONG_TERM",
212
+ /** 90 days - investments */
213
+ EXTENDED = "EXTENDED"
214
+ }
215
+ /** Outcome windows in milliseconds for each risk profile */
216
+ export declare const RISK_PROFILE_WINDOWS: Record<RiskProfile, number>;
217
+ /**
218
+ * Configuration for asymmetric trust dynamics
219
+ * Per ATSF v2.0: "Trust is hard to gain, easy to lose" (10:1 ratio)
220
+ */
221
+ export interface TrustDynamicsConfig {
222
+ /**
223
+ * Logarithmic gain rate for positive evidence
224
+ * Trust gain formula: delta = gainRate * log(1 + (ceiling - current))
225
+ * Default: 0.01 (slow gain)
226
+ */
227
+ gainRate: number;
228
+ /**
229
+ * Exponential loss rate for negative evidence
230
+ * Trust loss formula: delta = -lossRate * current
231
+ * Default: 0.10 (10x faster than gain)
232
+ */
233
+ lossRate: number;
234
+ /**
235
+ * Cooldown period in hours after any trust drop
236
+ * During cooldown, trust cannot increase
237
+ * Default: 168 hours (7 days)
238
+ */
239
+ cooldownHours: number;
240
+ /**
241
+ * Number of direction changes (gain→loss or loss→gain)
242
+ * within the oscillation window that triggers circuit breaker
243
+ * Default: 3
244
+ */
245
+ oscillationThreshold: number;
246
+ /**
247
+ * Time window in hours for oscillation detection
248
+ * Default: 24 hours
249
+ */
250
+ oscillationWindowHours: number;
251
+ /**
252
+ * Penalty multiplier for outcome reversals
253
+ * When provisional success becomes final failure
254
+ * Default: 2.0 (2x normal failure penalty)
255
+ */
256
+ reversalPenaltyMultiplier: number;
257
+ /**
258
+ * Minimum trust score threshold for circuit breaker trigger
259
+ * Default: 100 (trust < 100 on 0-1000 scale triggers circuit breaker)
260
+ */
261
+ circuitBreakerThreshold: number;
262
+ }
263
+ /** Default trust dynamics configuration per ATSF v2.0 */
264
+ export declare const DEFAULT_TRUST_DYNAMICS: TrustDynamicsConfig;
265
+ /**
266
+ * Cooldown state for an agent
267
+ */
268
+ export interface CooldownState {
269
+ /** Whether the agent is currently in cooldown */
270
+ inCooldown: boolean;
271
+ /** When the cooldown started */
272
+ cooldownStartedAt?: Date;
273
+ /** When the cooldown ends */
274
+ cooldownEndsAt?: Date;
275
+ /** Reason for cooldown */
276
+ reason?: string;
277
+ }
278
+ /**
279
+ * Direction change entry for oscillation detection
280
+ */
281
+ export interface DirectionChange {
282
+ /** Timestamp of the direction change */
283
+ timestamp: Date;
284
+ /** Previous direction: 'gain' or 'loss' */
285
+ from: 'gain' | 'loss';
286
+ /** New direction: 'gain' or 'loss' */
287
+ to: 'gain' | 'loss';
288
+ /** Trust score at time of change (0-1000) */
289
+ scoreAtChange: number;
290
+ }
291
+ /**
292
+ * Trust dynamics state for an agent
293
+ */
294
+ export interface TrustDynamicsState {
295
+ /** Agent ID */
296
+ agentId: string;
297
+ /** Current cooldown state */
298
+ cooldown: CooldownState;
299
+ /** Recent direction changes for oscillation detection */
300
+ directionChanges: DirectionChange[];
301
+ /** Last trust update direction */
302
+ lastDirection: 'gain' | 'loss' | 'none';
303
+ /** Whether circuit breaker is tripped */
304
+ circuitBreakerTripped: boolean;
305
+ /** Reason for circuit breaker if tripped */
306
+ circuitBreakerReason?: string;
307
+ /** When circuit breaker was tripped */
308
+ circuitBreakerTrippedAt?: Date;
309
+ }
310
+ /**
311
+ * Provisional outcome for temporal tracking
312
+ */
313
+ export interface ProvisionalOutcome {
314
+ /** Unique outcome ID */
315
+ outcomeId: string;
316
+ /** Associated agent ID */
317
+ agentId: string;
318
+ /** Action that generated this outcome */
319
+ actionId: string;
320
+ /** When the action was recorded */
321
+ recordedAt: Date;
322
+ /** Provisional success indicator */
323
+ provisionalSuccess: boolean;
324
+ /** Magnitude of the outcome (for tail risk detection) */
325
+ magnitude: number;
326
+ /** Risk profile determining outcome window */
327
+ riskProfile: RiskProfile;
328
+ /** When the outcome window closes */
329
+ outcomeWindowEnds: Date;
330
+ /** Final success (null if not yet finalized) */
331
+ finalSuccess: boolean | null;
332
+ /** Final magnitude (null if not yet finalized) */
333
+ finalMagnitude: number | null;
334
+ /** Whether this was a reversal (provisional success → final failure) */
335
+ wasReversal: boolean;
336
+ }
337
+ //# sourceMappingURL=trust-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust-profile.d.ts","sourceRoot":"","sources":["../../src/v2/trust-profile.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE7D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,eAAe;IAC9B,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,EAAE,EAAE,MAAM,CAAC;IACX,2EAA2E;IAC3E,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,sCAAsC;AACtC,eAAO,MAAM,qBAAqB,EAAE,YAMnC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,eAA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AwE;IACxE,WAAW,EAAE,OAAO,CAAC;CACtB"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Trust Profile types - represents an agent's current trust state
3
+ */
4
+ /** Default trust dimension weights */
5
+ export const DEFAULT_TRUST_WEIGHTS = {
6
+ CT: 0.25,
7
+ BT: 0.25,
8
+ GT: 0.20,
9
+ XT: 0.15,
10
+ AC: 0.15,
11
+ };
12
+ /**
13
+ * Default evidence type multipliers
14
+ *
15
+ * These multipliers solve the 1000-event cold-start problem by giving
16
+ * HITL approvals significantly more weight than automated observations.
17
+ */
18
+ export const EVIDENCE_TYPE_MULTIPLIERS = {
19
+ automated: 1.0,
20
+ hitl_approval: 5.0, // HITL approval = 5 automated observations
21
+ hitl_rejection: 5.0, // HITL rejection impact is also amplified
22
+ examination: 3.0, // Formal exams count more
23
+ audit: 3.0, // Audits are authoritative
24
+ sandbox_test: 0.5, // Sandbox/testnet observations count less (unverified)
25
+ peer_review: 2.0, // Cross-agent reviews have moderate weight
26
+ };
27
+ /**
28
+ * Default band thresholds on 0-1000 scale
29
+ *
30
+ * These thresholds determine which TrustBand an agent falls into
31
+ * based on their adjusted trust score.
32
+ *
33
+ * 8-tier model (T0-T7):
34
+ * - T0: Sandbox (0-199)
35
+ * - T1: Observed (200-349)
36
+ * - T2: Provisional (350-499)
37
+ * - T3: Monitored (500-649)
38
+ * - T4: Standard (650-799)
39
+ * - T5: Trusted (800-875)
40
+ * - T6: Certified (876-950)
41
+ * - T7: Autonomous (951-1000)
42
+ */
43
+ export const DEFAULT_BAND_THRESHOLDS = {
44
+ T0: { min: 0, max: 199 },
45
+ T1: { min: 200, max: 349 },
46
+ T2: { min: 350, max: 499 },
47
+ T3: { min: 500, max: 649 },
48
+ T4: { min: 650, max: 799 },
49
+ T5: { min: 800, max: 875 },
50
+ T6: { min: 876, max: 950 },
51
+ T7: { min: 951, max: 1000 },
52
+ };
53
+ /** Default banding configuration */
54
+ export const DEFAULT_BANDING_CONFIG = {
55
+ thresholds: DEFAULT_BAND_THRESHOLDS,
56
+ /** Points buffer on 0-1000 scale to prevent oscillation */
57
+ hysteresis: 30,
58
+ decayRate: 0.01,
59
+ promotionDelay: 7,
60
+ };
61
+ /**
62
+ * Risk profile for temporal outcome tracking
63
+ * Determines how long to wait before finalizing outcome
64
+ */
65
+ export var RiskProfile;
66
+ (function (RiskProfile) {
67
+ /** 5 minutes - computations, queries */
68
+ RiskProfile["IMMEDIATE"] = "IMMEDIATE";
69
+ /** 4 hours - API calls */
70
+ RiskProfile["SHORT_TERM"] = "SHORT_TERM";
71
+ /** 3 days - simple transactions */
72
+ RiskProfile["MEDIUM_TERM"] = "MEDIUM_TERM";
73
+ /** 30 days - financial trades */
74
+ RiskProfile["LONG_TERM"] = "LONG_TERM";
75
+ /** 90 days - investments */
76
+ RiskProfile["EXTENDED"] = "EXTENDED";
77
+ })(RiskProfile || (RiskProfile = {}));
78
+ /** Outcome windows in milliseconds for each risk profile */
79
+ export const RISK_PROFILE_WINDOWS = {
80
+ [RiskProfile.IMMEDIATE]: 5 * 60 * 1000, // 5 minutes
81
+ [RiskProfile.SHORT_TERM]: 4 * 60 * 60 * 1000, // 4 hours
82
+ [RiskProfile.MEDIUM_TERM]: 3 * 24 * 60 * 60 * 1000, // 3 days
83
+ [RiskProfile.LONG_TERM]: 30 * 24 * 60 * 60 * 1000, // 30 days
84
+ [RiskProfile.EXTENDED]: 90 * 24 * 60 * 60 * 1000, // 90 days
85
+ };
86
+ /** Default trust dynamics configuration per ATSF v2.0 */
87
+ export const DEFAULT_TRUST_DYNAMICS = {
88
+ gainRate: 0.01, // Logarithmic gain (slow)
89
+ lossRate: 0.10, // Exponential loss (10x faster)
90
+ cooldownHours: 168, // 7 days after any drop
91
+ oscillationThreshold: 3, // 3 direction changes triggers alert
92
+ oscillationWindowHours: 24, // Within 24 hours
93
+ reversalPenaltyMultiplier: 2.0, // 2x penalty for reversals
94
+ circuitBreakerThreshold: 100, // Trust < 100 (on 0-1000 scale) triggers circuit breaker
95
+ };
96
+ //# sourceMappingURL=trust-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trust-profile.js","sourceRoot":"","sources":["../../src/v2/trust-profile.ts"],"names":[],"mappings":"AAAA;;GAEG;AAwCH,sCAAsC;AACtC,MAAM,CAAC,MAAM,qBAAqB,GAAiB;IACjD,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;CACT,CAAC;AAkBF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAiC;IACrE,SAAS,EAAE,GAAG;IACd,aAAa,EAAE,GAAG,EAAK,2CAA2C;IAClE,cAAc,EAAE,GAAG,EAAI,0CAA0C;IACjE,WAAW,EAAE,GAAG,EAAO,0BAA0B;IACjD,KAAK,EAAE,GAAG,EAAa,2BAA2B;IAClD,YAAY,EAAE,GAAG,EAAM,uDAAuD;IAC9E,WAAW,EAAE,GAAG,EAAO,2CAA2C;CACnE,CAAC;AAyGF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,EAAE;IACxB,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;IAC1B,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