@vorionsys/atsf-core 0.2.2 → 0.2.4
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/CHANGELOG.md +3 -3
- package/README.md +77 -11
- package/dist/api/server.d.ts +4 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +3 -3
- package/dist/api/server.js.map +1 -1
- package/dist/basis/parser.d.ts +14 -14
- package/dist/common/adapters.d.ts +16 -9
- package/dist/common/adapters.d.ts.map +1 -1
- package/dist/common/adapters.js +69 -58
- package/dist/common/adapters.js.map +1 -1
- package/dist/common/config.d.ts +4 -3
- package/dist/common/config.d.ts.map +1 -1
- package/dist/common/config.js +2 -2
- package/dist/common/config.js.map +1 -1
- package/dist/common/types.d.ts +3 -3
- package/dist/crewai/callback.d.ts +91 -0
- package/dist/crewai/callback.d.ts.map +1 -0
- package/dist/crewai/callback.js +271 -0
- package/dist/crewai/callback.js.map +1 -0
- package/dist/crewai/executor.d.ts +226 -0
- package/dist/crewai/executor.d.ts.map +1 -0
- package/dist/crewai/executor.js +822 -0
- package/dist/crewai/executor.js.map +1 -0
- package/dist/crewai/index.d.ts +12 -0
- package/dist/crewai/index.d.ts.map +1 -0
- package/dist/crewai/index.js +12 -0
- package/dist/crewai/index.js.map +1 -0
- package/dist/crewai/tools.d.ts +21 -0
- package/dist/crewai/tools.d.ts.map +1 -0
- package/dist/crewai/tools.js +163 -0
- package/dist/crewai/tools.js.map +1 -0
- package/dist/crewai/types.d.ts +202 -0
- package/dist/crewai/types.d.ts.map +1 -0
- package/dist/crewai/types.js +9 -0
- package/dist/crewai/types.js.map +1 -0
- package/dist/enforce/index.d.ts +50 -2
- package/dist/enforce/index.d.ts.map +1 -1
- package/dist/enforce/index.js +73 -4
- package/dist/enforce/index.js.map +1 -1
- package/dist/enforce/trust-aware-enforcement-service.d.ts +121 -0
- package/dist/enforce/trust-aware-enforcement-service.d.ts.map +1 -0
- package/dist/enforce/trust-aware-enforcement-service.js +583 -0
- package/dist/enforce/trust-aware-enforcement-service.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/intent/index.d.ts +18 -3
- package/dist/intent/index.d.ts.map +1 -1
- package/dist/intent/index.js +37 -6
- package/dist/intent/index.js.map +1 -1
- package/dist/intent/persistent-intent-service.d.ts +68 -0
- package/dist/intent/persistent-intent-service.d.ts.map +1 -0
- package/dist/intent/persistent-intent-service.js +265 -0
- package/dist/intent/persistent-intent-service.js.map +1 -0
- package/dist/intent/supabase-intent-repository.d.ts +124 -0
- package/dist/intent/supabase-intent-repository.d.ts.map +1 -0
- package/dist/intent/supabase-intent-repository.js +404 -0
- package/dist/intent/supabase-intent-repository.js.map +1 -0
- package/dist/langchain/tools.d.ts.map +1 -1
- package/dist/langchain/tools.js +1 -3
- package/dist/langchain/tools.js.map +1 -1
- package/dist/layers/implementations/L0-request-format.d.ts +37 -0
- package/dist/layers/implementations/L0-request-format.d.ts.map +1 -0
- package/dist/layers/implementations/L0-request-format.js +216 -0
- package/dist/layers/implementations/L0-request-format.js.map +1 -0
- package/dist/layers/implementations/L1-input-size.d.ts +36 -0
- package/dist/layers/implementations/L1-input-size.d.ts.map +1 -0
- package/dist/layers/implementations/L1-input-size.js +150 -0
- package/dist/layers/implementations/L1-input-size.js.map +1 -0
- package/dist/layers/implementations/L2-charset-sanitizer.d.ts +28 -0
- package/dist/layers/implementations/L2-charset-sanitizer.d.ts.map +1 -0
- package/dist/layers/implementations/L2-charset-sanitizer.js +220 -0
- package/dist/layers/implementations/L2-charset-sanitizer.js.map +1 -0
- package/dist/layers/implementations/L3-schema-conformance.d.ts +47 -0
- package/dist/layers/implementations/L3-schema-conformance.d.ts.map +1 -0
- package/dist/layers/implementations/L3-schema-conformance.js +258 -0
- package/dist/layers/implementations/L3-schema-conformance.js.map +1 -0
- package/dist/layers/implementations/L4-injection-detector.d.ts +47 -0
- package/dist/layers/implementations/L4-injection-detector.d.ts.map +1 -0
- package/dist/layers/implementations/L4-injection-detector.js +256 -0
- package/dist/layers/implementations/L4-injection-detector.js.map +1 -0
- package/dist/layers/implementations/L5-rate-limiter.d.ts +51 -0
- package/dist/layers/implementations/L5-rate-limiter.d.ts.map +1 -0
- package/dist/layers/implementations/L5-rate-limiter.js +183 -0
- package/dist/layers/implementations/L5-rate-limiter.js.map +1 -0
- package/dist/layers/implementations/index.d.ts +16 -0
- package/dist/layers/implementations/index.d.ts.map +1 -0
- package/dist/layers/implementations/index.js +16 -0
- package/dist/layers/implementations/index.js.map +1 -0
- package/dist/persistence/sqlite.d.ts.map +1 -1
- package/dist/persistence/sqlite.js +4 -3
- package/dist/persistence/sqlite.js.map +1 -1
- package/dist/persistence/supabase.js +2 -2
- package/dist/persistence/supabase.js.map +1 -1
- package/dist/phase6/ceiling.js +5 -5
- package/dist/phase6/ceiling.js.map +1 -1
- package/dist/phase6/context.js +6 -6
- package/dist/phase6/context.js.map +1 -1
- package/dist/phase6/index.d.ts +1 -1
- package/dist/phase6/index.js +1 -1
- package/dist/phase6/role-gates.js +2 -2
- package/dist/phase6/role-gates.js.map +1 -1
- package/dist/phase6/types.d.ts +31 -30
- package/dist/phase6/types.d.ts.map +1 -1
- package/dist/phase6/types.js +17 -12
- package/dist/phase6/types.js.map +1 -1
- package/dist/phase6/weight-presets/canonical.d.ts +2 -2
- package/dist/phase6/weight-presets/canonical.js +2 -2
- package/dist/phase6/weight-presets/index.d.ts +1 -1
- package/dist/phase6/weight-presets/index.js +1 -1
- package/dist/phase6/weight-presets/merger.d.ts +1 -1
- package/dist/phase6/weight-presets/merger.js +1 -1
- package/dist/proof/merkle.d.ts +21 -0
- package/dist/proof/merkle.d.ts.map +1 -1
- package/dist/proof/merkle.js +92 -7
- package/dist/proof/merkle.js.map +1 -1
- package/dist/trust-engine/ceiling-enforcement/kernel.d.ts +11 -9
- package/dist/trust-engine/ceiling-enforcement/kernel.d.ts.map +1 -1
- package/dist/trust-engine/ceiling-enforcement/kernel.js +25 -19
- package/dist/trust-engine/ceiling-enforcement/kernel.js.map +1 -1
- package/dist/trust-engine/decay-profiles.d.ts +37 -136
- package/dist/trust-engine/decay-profiles.d.ts.map +1 -1
- package/dist/trust-engine/decay-profiles.js +68 -178
- package/dist/trust-engine/decay-profiles.js.map +1 -1
- package/dist/trust-engine/index.d.ts +96 -63
- package/dist/trust-engine/index.d.ts.map +1 -1
- package/dist/trust-engine/index.js +183 -112
- package/dist/trust-engine/index.js.map +1 -1
- package/dist/trust-engine/phase6-types.d.ts +10 -3
- package/dist/trust-engine/phase6-types.d.ts.map +1 -1
- package/dist/trust-engine/phase6-types.js +19 -13
- package/dist/trust-engine/phase6-types.js.map +1 -1
- package/package.json +5 -4
|
@@ -1,210 +1,100 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Stepped Milestone Trust Decay
|
|
3
3
|
*
|
|
4
|
-
* Implements
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Implements a simple stepped decay system where trust scores decay
|
|
5
|
+
* based on fixed milestones tied to days of inactivity. Interpolation
|
|
6
|
+
* between milestones provides smooth decay curves.
|
|
7
|
+
*
|
|
8
|
+
* 9 milestones (not counting day 0):
|
|
9
|
+
* - Steps 1-5 drop 6% each (days 7, 14, 28, 42, 56)
|
|
10
|
+
* - Steps 6-9 drop 5% each (days 84, 112, 140, 182)
|
|
11
|
+
* - At 182 days = 50% of original score
|
|
8
12
|
*
|
|
9
13
|
* @packageDocumentation
|
|
10
14
|
*/
|
|
11
15
|
// ============================================================================
|
|
12
|
-
//
|
|
16
|
+
// Milestones
|
|
13
17
|
// ============================================================================
|
|
14
18
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - **Volatile**: High-frequency trading, real-time systems
|
|
18
|
-
* - 30-day half-life (fast decay for frequently-used agents)
|
|
19
|
-
* - 4x failure multiplier (harsh penalties for failures)
|
|
19
|
+
* Fixed decay milestones for inactivity-based trust decay
|
|
20
20
|
*
|
|
21
|
-
* -
|
|
22
|
-
*
|
|
23
|
-
* - 3x failure multiplier (moderate penalties)
|
|
24
|
-
*
|
|
25
|
-
* - **Stable**: Audit systems, compliance agents, infrequent operations
|
|
26
|
-
* - 365-day half-life (slow decay for long-running agents)
|
|
27
|
-
* - 2x failure multiplier (lenient penalties)
|
|
21
|
+
* Steps 1-5 drop 6% each. Steps 6-9 drop 5% each.
|
|
22
|
+
* At 182 days of inactivity, score is 50% of original.
|
|
28
23
|
*/
|
|
29
|
-
export const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
stable: {
|
|
42
|
-
type: 'stable',
|
|
43
|
-
baseHalfLifeDays: 365,
|
|
44
|
-
failureMultiplier: 2.0,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
24
|
+
export const DECAY_MILESTONES = [
|
|
25
|
+
{ days: 0, multiplier: 1.00 },
|
|
26
|
+
{ days: 7, multiplier: 0.94 },
|
|
27
|
+
{ days: 14, multiplier: 0.88 },
|
|
28
|
+
{ days: 28, multiplier: 0.82 },
|
|
29
|
+
{ days: 42, multiplier: 0.76 },
|
|
30
|
+
{ days: 56, multiplier: 0.70 },
|
|
31
|
+
{ days: 84, multiplier: 0.65 },
|
|
32
|
+
{ days: 112, multiplier: 0.60 },
|
|
33
|
+
{ days: 140, multiplier: 0.55 },
|
|
34
|
+
{ days: 182, multiplier: 0.50 },
|
|
35
|
+
];
|
|
48
36
|
// ============================================================================
|
|
49
37
|
// Core Decay Functions
|
|
50
38
|
// ============================================================================
|
|
51
39
|
/**
|
|
52
|
-
* Calculate
|
|
53
|
-
*
|
|
54
|
-
* Uses exponential decay formula with half-life:
|
|
55
|
-
* `score * (0.5 ^ (days / halfLife)) / (failureMultiplier ^ failureCount)`
|
|
56
|
-
*
|
|
57
|
-
* @param initialScore - Starting trust score (0-1000)
|
|
58
|
-
* @param daysSinceLastAction - Days since last trust-relevant action
|
|
59
|
-
* @param profile - Environment profile to use for decay calculation
|
|
60
|
-
* @param failureCount - Number of recent failures (0 for no failures)
|
|
61
|
-
* @returns Decayed trust score, floored at 0
|
|
62
|
-
*/
|
|
63
|
-
export function calculateContextAwareDecay(initialScore, daysSinceLastAction, profile, failureCount) {
|
|
64
|
-
// Calculate base decay factor using half-life formula
|
|
65
|
-
// At half-life days, this equals 0.5 (50% remaining)
|
|
66
|
-
const baseDecayFactor = Math.pow(0.5, daysSinceLastAction / profile.baseHalfLifeDays);
|
|
67
|
-
// Calculate failure acceleration (exponential penalty)
|
|
68
|
-
// Treat negative failure counts as 0
|
|
69
|
-
const effectiveFailures = Math.max(0, failureCount);
|
|
70
|
-
const failureAcceleration = Math.pow(profile.failureMultiplier, effectiveFailures);
|
|
71
|
-
// Apply decay: score * baseFactor / failureAcceleration
|
|
72
|
-
const decayedScore = (initialScore * baseDecayFactor) / failureAcceleration;
|
|
73
|
-
// Floor at 0
|
|
74
|
-
return Math.max(0, decayedScore);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Calculate context-aware decay with detailed breakdown
|
|
40
|
+
* Calculate the decay multiplier for a given number of days since last activity
|
|
78
41
|
*
|
|
79
|
-
*
|
|
42
|
+
* Finds the two surrounding milestones and linearly interpolates between them
|
|
43
|
+
* for a smooth decay curve. Returns the floor multiplier (0.50) for days
|
|
44
|
+
* beyond the last milestone.
|
|
80
45
|
*
|
|
81
|
-
* @param
|
|
82
|
-
* @
|
|
83
|
-
* @param profile - Environment profile to use
|
|
84
|
-
* @param failureCount - Number of recent failures
|
|
85
|
-
* @returns Detailed calculation result
|
|
46
|
+
* @param daysSinceLastActivity - Days since the entity's last trust-relevant action
|
|
47
|
+
* @returns Decay multiplier between 0.50 and 1.00
|
|
86
48
|
*/
|
|
87
|
-
export function
|
|
88
|
-
//
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const effectiveFailures = Math.max(0, failureCount);
|
|
92
|
-
const failureAcceleration = Math.pow(profile.failureMultiplier, effectiveFailures);
|
|
93
|
-
// Calculate effective decay factor (after failure penalty)
|
|
94
|
-
const effectiveDecayFactor = baseDecayFactor / failureAcceleration;
|
|
95
|
-
// Calculate final score
|
|
96
|
-
const decayedScore = Math.max(0, initialScore * effectiveDecayFactor);
|
|
97
|
-
return {
|
|
98
|
-
decayedScore,
|
|
99
|
-
baseDecayFactor,
|
|
100
|
-
effectiveDecayFactor,
|
|
101
|
-
failureAcceleration,
|
|
102
|
-
profileUsed: profile.type,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Calculate days until score decays to target value
|
|
107
|
-
*
|
|
108
|
-
* Inverse of the decay formula to predict when a threshold will be reached.
|
|
109
|
-
*
|
|
110
|
-
* @param currentScore - Current trust score
|
|
111
|
-
* @param targetScore - Target score to calculate time for
|
|
112
|
-
* @param profile - Environment profile
|
|
113
|
-
* @param failureCount - Number of recent failures
|
|
114
|
-
* @returns Days until target is reached, or Infinity if unreachable
|
|
115
|
-
*/
|
|
116
|
-
export function calculateDaysUntilDecay(currentScore, targetScore, profile, failureCount) {
|
|
117
|
-
// If already at or below target, return Infinity (already there)
|
|
118
|
-
if (currentScore <= targetScore) {
|
|
119
|
-
return Infinity;
|
|
49
|
+
export function calculateDecayMultiplier(daysSinceLastActivity) {
|
|
50
|
+
// Negative or zero days = no decay
|
|
51
|
+
if (daysSinceLastActivity <= 0) {
|
|
52
|
+
return 1.0;
|
|
120
53
|
}
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
54
|
+
// Beyond the last milestone = floor multiplier
|
|
55
|
+
const lastMilestone = DECAY_MILESTONES[DECAY_MILESTONES.length - 1];
|
|
56
|
+
if (daysSinceLastActivity >= lastMilestone.days) {
|
|
57
|
+
return lastMilestone.multiplier;
|
|
124
58
|
}
|
|
125
|
-
//
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
59
|
+
// Find the two surrounding milestones and interpolate
|
|
60
|
+
for (let i = 0; i < DECAY_MILESTONES.length - 1; i++) {
|
|
61
|
+
const current = DECAY_MILESTONES[i];
|
|
62
|
+
const next = DECAY_MILESTONES[i + 1];
|
|
63
|
+
if (daysSinceLastActivity >= current.days && daysSinceLastActivity < next.days) {
|
|
64
|
+
// Linear interpolation between milestones
|
|
65
|
+
const progress = (daysSinceLastActivity - current.days) / (next.days - current.days);
|
|
66
|
+
return current.multiplier + progress * (next.multiplier - current.multiplier);
|
|
67
|
+
}
|
|
133
68
|
}
|
|
134
|
-
//
|
|
135
|
-
|
|
136
|
-
// log(target / current) = (days / halfLife) * log(0.5)
|
|
137
|
-
// days = halfLife * log(target / current) / log(0.5)
|
|
138
|
-
const ratio = targetScore / effectiveCurrentScore;
|
|
139
|
-
const days = profile.baseHalfLifeDays * Math.log(ratio) / Math.log(0.5);
|
|
140
|
-
return Math.max(0, days);
|
|
69
|
+
// Fallback (should not be reached)
|
|
70
|
+
return lastMilestone.multiplier;
|
|
141
71
|
}
|
|
142
|
-
// ============================================================================
|
|
143
|
-
// Profile Classification
|
|
144
|
-
// ============================================================================
|
|
145
|
-
/**
|
|
146
|
-
* Activity rate thresholds for profile classification
|
|
147
|
-
*/
|
|
148
|
-
const ACTIVITY_THRESHOLDS = {
|
|
149
|
-
volatile: 100, // >= 100 actions/day = volatile
|
|
150
|
-
standard: 10, // >= 10 actions/day = standard
|
|
151
|
-
// < 10 actions/day = stable
|
|
152
|
-
};
|
|
153
72
|
/**
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* Automatically determines the appropriate decay profile based on
|
|
157
|
-
* how frequently an agent performs trust-relevant actions.
|
|
73
|
+
* Apply decay to a base trust score based on days of inactivity
|
|
158
74
|
*
|
|
159
|
-
* @param
|
|
160
|
-
* @
|
|
75
|
+
* @param baseScore - The entity's base trust score (0-1000)
|
|
76
|
+
* @param daysSinceLastActivity - Days since the entity's last trust-relevant action
|
|
77
|
+
* @returns Decayed score as a rounded integer, minimum 0
|
|
161
78
|
*/
|
|
162
|
-
export function
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
if (actionsPerDay >= ACTIVITY_THRESHOLDS.standard) {
|
|
167
|
-
return DEFAULT_DECAY_PROFILES.profiles.standard;
|
|
168
|
-
}
|
|
169
|
-
return DEFAULT_DECAY_PROFILES.profiles.stable;
|
|
79
|
+
export function applyDecay(baseScore, daysSinceLastActivity) {
|
|
80
|
+
const multiplier = calculateDecayMultiplier(daysSinceLastActivity);
|
|
81
|
+
return Math.max(0, Math.round(baseScore * multiplier));
|
|
170
82
|
}
|
|
171
83
|
/**
|
|
172
|
-
* Get the
|
|
84
|
+
* Get the next decay milestone that the entity will hit
|
|
173
85
|
*
|
|
174
|
-
*
|
|
175
|
-
*
|
|
86
|
+
* Returns the next milestone after the entity's current inactivity period,
|
|
87
|
+
* or null if the entity has already passed the final milestone.
|
|
176
88
|
*
|
|
177
|
-
* @param
|
|
178
|
-
* @
|
|
179
|
-
* @param config - Decay configuration with overrides
|
|
180
|
-
* @returns Environment profile for the entity
|
|
89
|
+
* @param daysSinceLastActivity - Days since the entity's last trust-relevant action
|
|
90
|
+
* @returns The next DecayMilestone, or null if past the final milestone
|
|
181
91
|
*/
|
|
182
|
-
export function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
// Use auto-classification if enabled
|
|
189
|
-
if (config.autoClassification) {
|
|
190
|
-
return classifyEnvironmentProfile(actionsPerDay);
|
|
92
|
+
export function getNextDecayMilestone(daysSinceLastActivity) {
|
|
93
|
+
for (const milestone of DECAY_MILESTONES) {
|
|
94
|
+
if (milestone.days > daysSinceLastActivity) {
|
|
95
|
+
return milestone;
|
|
96
|
+
}
|
|
191
97
|
}
|
|
192
|
-
|
|
193
|
-
return DEFAULT_DECAY_PROFILES.profiles.standard;
|
|
194
|
-
}
|
|
195
|
-
// ============================================================================
|
|
196
|
-
// Configuration Factory
|
|
197
|
-
// ============================================================================
|
|
198
|
-
/**
|
|
199
|
-
* Create a decay configuration with defaults
|
|
200
|
-
*
|
|
201
|
-
* @param options - Configuration options
|
|
202
|
-
* @returns Complete decay configuration
|
|
203
|
-
*/
|
|
204
|
-
export function createDecayConfig(options = {}) {
|
|
205
|
-
return {
|
|
206
|
-
autoClassification: options.autoClassification ?? true,
|
|
207
|
-
overrideByAgentId: options.overrideByAgentId ?? new Map(),
|
|
208
|
-
};
|
|
98
|
+
return null;
|
|
209
99
|
}
|
|
210
100
|
//# sourceMappingURL=decay-profiles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decay-profiles.js","sourceRoot":"","sources":["../../src/trust-engine/decay-profiles.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"decay-profiles.js","sourceRoot":"","sources":["../../src/trust-engine/decay-profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAgBH,+EAA+E;AAC/E,aAAa;AACb,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,EAAE,IAAI,EAAE,CAAC,EAAI,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,CAAC,EAAI,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,EAAE,EAAG,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,EAAE,EAAG,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,EAAE,EAAG,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,EAAE,EAAG,UAAU,EAAE,IAAI,EAAE;IAC/B,EAAE,IAAI,EAAE,EAAE,EAAG,UAAU,EAA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,CAAC;IACH,CAAC;IAED,mCAAmC;IACnC,OAAO,aAAa,CAAC,UAAU,CAAC;AAClC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,SAAiB,EAAE,qBAA6B;IACzE,MAAM,UAAU,GAAG,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IACnE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB,CAAC,qBAA6B;IACjE,KAAK,MAAM,SAAS,IAAI,gBAAgB,EAAE,CAAC;QACzC,IAAI,SAAS,CAAC,IAAI,GAAG,qBAAqB,EAAE,CAAC;YAC3C,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* Trust Engine - Behavioral Trust Scoring
|
|
3
3
|
*
|
|
4
4
|
* Calculates and maintains trust scores for entities based on behavioral signals.
|
|
5
|
-
* Features
|
|
5
|
+
* Features 8-tier trust system (T0-T7) with event emission for observability.
|
|
6
6
|
*
|
|
7
7
|
* @packageDocumentation
|
|
8
8
|
*/
|
|
9
9
|
import { EventEmitter } from 'events';
|
|
10
10
|
import type { TrustScore, TrustLevel, TrustSignal, TrustComponents, ID } from '../common/types.js';
|
|
11
11
|
import type { PersistenceProvider } from '../persistence/types.js';
|
|
12
|
+
import { initialFactorScores, type FactorCodeString } from '@vorionsys/basis';
|
|
12
13
|
/**
|
|
13
14
|
* Trust level thresholds (8 tiers T0-T7) - per BASIS specification
|
|
14
15
|
*/
|
|
@@ -20,14 +21,20 @@ export declare const TRUST_THRESHOLDS: Record<TrustLevel, {
|
|
|
20
21
|
* Trust level names (8 tiers T0-T7) - per BASIS specification
|
|
21
22
|
*/
|
|
22
23
|
export declare const TRUST_LEVEL_NAMES: Record<TrustLevel, string>;
|
|
24
|
+
export declare const FACTOR_CODES: readonly ["CT-COMP", "CT-REL", "CT-OBS", "CT-TRANS", "CT-ACCT", "CT-SAFE", "CT-SEC", "CT-PRIV", "CT-ID", "OP-HUMAN", "OP-ALIGN", "OP-CONTEXT", "OP-STEW", "SF-HUM", "SF-ADAPT", "SF-LEARN"];
|
|
25
|
+
export type FactorCode = FactorCodeString;
|
|
26
|
+
export declare const FACTOR_WEIGHTS: Record<"CT-COMP" | "CT-REL" | "CT-OBS" | "CT-TRANS" | "CT-ACCT" | "CT-SAFE" | "CT-SEC" | "CT-PRIV" | "CT-ID" | "OP-HUMAN" | "OP-ALIGN" | "OP-CONTEXT" | "OP-STEW" | "SF-HUM" | "SF-ADAPT" | "SF-LEARN", number>;
|
|
27
|
+
export declare const SIGNAL_PREFIX_TO_FACTORS: Record<string, ("CT-COMP" | "CT-REL" | "CT-OBS" | "CT-TRANS" | "CT-ACCT" | "CT-SAFE" | "CT-SEC" | "CT-PRIV" | "CT-ID" | "OP-HUMAN" | "OP-ALIGN" | "OP-CONTEXT" | "OP-STEW" | "SF-HUM" | "SF-ADAPT" | "SF-LEARN")[]>;
|
|
28
|
+
export { initialFactorScores };
|
|
23
29
|
/**
|
|
30
|
+
* @deprecated Use FACTOR_WEIGHTS for 16-factor scoring. Kept for backwards compatibility.
|
|
24
31
|
* Signal weights for score calculation
|
|
25
32
|
*/
|
|
26
33
|
export declare const SIGNAL_WEIGHTS: Record<keyof TrustComponents, number>;
|
|
27
34
|
/**
|
|
28
35
|
* Trust event types
|
|
29
36
|
*/
|
|
30
|
-
export type TrustEventType = 'trust:initialized' | 'trust:signal_recorded' | 'trust:score_changed' | 'trust:tier_changed' | 'trust:decay_applied' | 'trust:
|
|
37
|
+
export type TrustEventType = 'trust:initialized' | 'trust:signal_recorded' | 'trust:score_changed' | 'trust:tier_changed' | 'trust:decay_applied' | 'trust:recovery_applied' | 'trust:recovery_milestone';
|
|
31
38
|
/**
|
|
32
39
|
* Base trust event
|
|
33
40
|
*/
|
|
@@ -83,16 +90,6 @@ export interface TrustDecayAppliedEvent extends TrustEvent {
|
|
|
83
90
|
newScore: TrustScore;
|
|
84
91
|
decayAmount: number;
|
|
85
92
|
stalenessMs: number;
|
|
86
|
-
accelerated: boolean;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Failure detected event
|
|
90
|
-
*/
|
|
91
|
-
export interface TrustFailureDetectedEvent extends TrustEvent {
|
|
92
|
-
type: 'trust:failure_detected';
|
|
93
|
-
signal: TrustSignal;
|
|
94
|
-
failureCount: number;
|
|
95
|
-
acceleratedDecayActive: boolean;
|
|
96
93
|
}
|
|
97
94
|
/**
|
|
98
95
|
* Recovery applied event
|
|
@@ -119,7 +116,7 @@ export interface TrustRecoveryMilestoneEvent extends TrustEvent {
|
|
|
119
116
|
/**
|
|
120
117
|
* Union of all trust events
|
|
121
118
|
*/
|
|
122
|
-
export type AnyTrustEvent = TrustInitializedEvent | TrustSignalRecordedEvent | TrustScoreChangedEvent | TrustTierChangedEvent | TrustDecayAppliedEvent |
|
|
119
|
+
export type AnyTrustEvent = TrustInitializedEvent | TrustSignalRecordedEvent | TrustScoreChangedEvent | TrustTierChangedEvent | TrustDecayAppliedEvent | TrustRecoveryAppliedEvent | TrustRecoveryMilestoneEvent;
|
|
123
120
|
/**
|
|
124
121
|
* Entity trust record
|
|
125
122
|
*/
|
|
@@ -127,12 +124,13 @@ export interface TrustRecord {
|
|
|
127
124
|
entityId: ID;
|
|
128
125
|
score: TrustScore;
|
|
129
126
|
level: TrustLevel;
|
|
127
|
+
/** @deprecated Use factorScores instead */
|
|
130
128
|
components: TrustComponents;
|
|
129
|
+
/** Per-factor scores (0.0 to 1.0) for each of the 16 trust factors */
|
|
130
|
+
factorScores: Record<string, number>;
|
|
131
131
|
signals: TrustSignal[];
|
|
132
132
|
lastCalculatedAt: string;
|
|
133
133
|
history: TrustHistoryEntry[];
|
|
134
|
-
/** Recent failure timestamps for accelerated decay */
|
|
135
|
-
recentFailures: string[];
|
|
136
134
|
/** Recent success timestamps for recovery */
|
|
137
135
|
recentSuccesses: string[];
|
|
138
136
|
/** Peak score achieved (for recovery milestone tracking) */
|
|
@@ -155,25 +153,62 @@ export interface TrustHistoryEntry {
|
|
|
155
153
|
export interface TrustCalculation {
|
|
156
154
|
score: TrustScore;
|
|
157
155
|
level: TrustLevel;
|
|
156
|
+
/** @deprecated Use factorScores */
|
|
158
157
|
components: TrustComponents;
|
|
158
|
+
/** Per-factor scores for all 16 trust factors */
|
|
159
|
+
factorScores: Record<string, number>;
|
|
159
160
|
factors: string[];
|
|
160
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* Human-readable explanation of a trust score.
|
|
164
|
+
*
|
|
165
|
+
* Returned by `TrustEngine.explainScore()` to provide full transparency
|
|
166
|
+
* into how a score was computed. Every field is designed for audit logs,
|
|
167
|
+
* dashboards, or end-user display.
|
|
168
|
+
*/
|
|
169
|
+
export interface TrustExplanation {
|
|
170
|
+
/** Entity ID */
|
|
171
|
+
entityId: ID;
|
|
172
|
+
/** Final trust score (0-1000) */
|
|
173
|
+
score: TrustScore;
|
|
174
|
+
/** Trust level index (0-7) */
|
|
175
|
+
level: TrustLevel;
|
|
176
|
+
/** Human-readable level name (e.g. "Trusted") */
|
|
177
|
+
levelName: string;
|
|
178
|
+
/** Score range for the current level */
|
|
179
|
+
levelRange: {
|
|
180
|
+
min: number;
|
|
181
|
+
max: number;
|
|
182
|
+
};
|
|
183
|
+
/** Score needed to reach the next level (null if at T7) */
|
|
184
|
+
pointsToNextLevel: number | null;
|
|
185
|
+
/** Total number of signals ingested */
|
|
186
|
+
signalCount: number;
|
|
187
|
+
/** Breakdown of each factor: code, weight, raw score, weighted contribution */
|
|
188
|
+
factorBreakdown: {
|
|
189
|
+
code: string;
|
|
190
|
+
weight: number;
|
|
191
|
+
rawScore: number;
|
|
192
|
+
/** Contribution = rawScore * weight * 1000 (portion of final score) */
|
|
193
|
+
contribution: number;
|
|
194
|
+
}[];
|
|
195
|
+
/** Top factors contributing positively (sorted by contribution desc) */
|
|
196
|
+
topPositiveFactors: string[];
|
|
197
|
+
/** Top factors dragging score down (sorted by contribution asc) */
|
|
198
|
+
topNegativeFactors: string[];
|
|
199
|
+
/** Decay multiplier currently applied (1.0 = no decay) */
|
|
200
|
+
decayMultiplier: number;
|
|
201
|
+
/** Days since last signal */
|
|
202
|
+
daysSinceLastSignal: number | null;
|
|
203
|
+
/** ISO timestamp of explanation generation */
|
|
204
|
+
generatedAt: string;
|
|
205
|
+
}
|
|
161
206
|
/**
|
|
162
207
|
* Trust Engine configuration
|
|
163
208
|
*/
|
|
164
209
|
export interface TrustEngineConfig {
|
|
165
|
-
/**
|
|
166
|
-
|
|
167
|
-
/** Decay interval in milliseconds (default: 60000 = 1 minute) */
|
|
168
|
-
decayIntervalMs?: number;
|
|
169
|
-
/** Signal value threshold below which a signal is considered a failure (default: 0.3) */
|
|
170
|
-
failureThreshold?: number;
|
|
171
|
-
/** Multiplier applied to decay rate when entity has recent failures (default: 3.0) */
|
|
172
|
-
acceleratedDecayMultiplier?: number;
|
|
173
|
-
/** Time window in ms to consider failures as "recent" (default: 3600000 = 1 hour) */
|
|
174
|
-
failureWindowMs?: number;
|
|
175
|
-
/** Minimum failures within window to trigger accelerated decay (default: 2) */
|
|
176
|
-
minFailuresForAcceleration?: number;
|
|
210
|
+
/** How often to check for and apply decay, in milliseconds (default: 60000 = 1 minute) */
|
|
211
|
+
decayCheckIntervalMs?: number;
|
|
177
212
|
/** Persistence provider for storing trust records */
|
|
178
213
|
persistence?: PersistenceProvider;
|
|
179
214
|
/** Auto-persist changes (default: true when persistence is provided) */
|
|
@@ -202,12 +237,7 @@ export interface TrustEngineConfig {
|
|
|
202
237
|
*/
|
|
203
238
|
export declare class TrustEngine extends EventEmitter {
|
|
204
239
|
private records;
|
|
205
|
-
private
|
|
206
|
-
private _decayIntervalMs;
|
|
207
|
-
private _failureThreshold;
|
|
208
|
-
private _acceleratedDecayMultiplier;
|
|
209
|
-
private _failureWindowMs;
|
|
210
|
-
private _minFailuresForAcceleration;
|
|
240
|
+
private _decayCheckIntervalMs;
|
|
211
241
|
private _persistence?;
|
|
212
242
|
private _autoPersist;
|
|
213
243
|
private _successThreshold;
|
|
@@ -265,21 +295,9 @@ export declare class TrustEngine extends EventEmitter {
|
|
|
265
295
|
maxListenersPerEvent: number;
|
|
266
296
|
};
|
|
267
297
|
/**
|
|
268
|
-
* Get the
|
|
269
|
-
*/
|
|
270
|
-
get decayRate(): number;
|
|
271
|
-
/**
|
|
272
|
-
* Get the decay interval in milliseconds
|
|
273
|
-
*/
|
|
274
|
-
get decayIntervalMs(): number;
|
|
275
|
-
/**
|
|
276
|
-
* Get the failure threshold
|
|
298
|
+
* Get the decay check interval in milliseconds
|
|
277
299
|
*/
|
|
278
|
-
get
|
|
279
|
-
/**
|
|
280
|
-
* Get the accelerated decay multiplier
|
|
281
|
-
*/
|
|
282
|
-
get acceleratedDecayMultiplier(): number;
|
|
300
|
+
get decayCheckIntervalMs(): number;
|
|
283
301
|
/**
|
|
284
302
|
* Get the persistence provider
|
|
285
303
|
*/
|
|
@@ -320,14 +338,6 @@ export declare class TrustEngine extends EventEmitter {
|
|
|
320
338
|
* Calculate trust score for an entity
|
|
321
339
|
*/
|
|
322
340
|
calculate(entityId: ID): Promise<TrustCalculation>;
|
|
323
|
-
/**
|
|
324
|
-
* Check if an entity has accelerated decay active
|
|
325
|
-
*/
|
|
326
|
-
private hasAcceleratedDecay;
|
|
327
|
-
/**
|
|
328
|
-
* Clean up old failure timestamps outside the window
|
|
329
|
-
*/
|
|
330
|
-
private cleanupFailures;
|
|
331
341
|
/**
|
|
332
342
|
* Clean up old success timestamps outside the window
|
|
333
343
|
*/
|
|
@@ -348,8 +358,16 @@ export declare class TrustEngine extends EventEmitter {
|
|
|
348
358
|
* Get trust score for an entity (with automatic decay)
|
|
349
359
|
*/
|
|
350
360
|
getScore(entityId: ID): Promise<TrustRecord | undefined>;
|
|
361
|
+
/**
|
|
362
|
+
* Validate a trust signal before ingestion.
|
|
363
|
+
* Rejects NaN, Infinity, out-of-range values, and missing required fields.
|
|
364
|
+
*
|
|
365
|
+
* @throws Error on invalid signal
|
|
366
|
+
*/
|
|
367
|
+
private validateSignal;
|
|
351
368
|
/**
|
|
352
369
|
* Record a trust signal
|
|
370
|
+
* @throws Error if signal is invalid (NaN, out of range, missing fields)
|
|
353
371
|
*/
|
|
354
372
|
recordSignal(signal: TrustSignal): Promise<void>;
|
|
355
373
|
/**
|
|
@@ -364,14 +382,37 @@ export declare class TrustEngine extends EventEmitter {
|
|
|
364
382
|
* Get trust level name
|
|
365
383
|
*/
|
|
366
384
|
getLevelName(level: TrustLevel): string;
|
|
385
|
+
/**
|
|
386
|
+
* Generate a human-readable explanation of an entity's current trust score.
|
|
387
|
+
*
|
|
388
|
+
* Provides full transparency into how the score was computed, including
|
|
389
|
+
* per-factor contributions, decay status, and what's needed to advance.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```ts
|
|
393
|
+
* const explanation = await engine.explainScore('agent-123');
|
|
394
|
+
* console.log(`Score: ${explanation.score} (${explanation.levelName})`);
|
|
395
|
+
* console.log(`Top factor: ${explanation.topPositiveFactors[0]}`);
|
|
396
|
+
* console.log(`Points to next tier: ${explanation.pointsToNextLevel}`);
|
|
397
|
+
* ```
|
|
398
|
+
*/
|
|
399
|
+
explainScore(entityId: ID): Promise<TrustExplanation>;
|
|
367
400
|
/**
|
|
368
401
|
* Convert score to trust level
|
|
369
402
|
*/
|
|
370
403
|
private scoreToLevel;
|
|
371
404
|
/**
|
|
405
|
+
* @deprecated Use calculateFactorScores for 16-factor model. Kept for backwards compatibility.
|
|
372
406
|
* Calculate component scores from signals
|
|
373
407
|
*/
|
|
374
408
|
private calculateComponents;
|
|
409
|
+
/**
|
|
410
|
+
* Calculate per-factor scores from signals.
|
|
411
|
+
* Signals can use either:
|
|
412
|
+
* - Factor code prefix (e.g. 'CT-COMP.success')
|
|
413
|
+
* - Legacy bucket prefix (e.g. 'behavioral.success') — mapped to factors via SIGNAL_PREFIX_TO_FACTORS
|
|
414
|
+
*/
|
|
415
|
+
private calculateFactorScores;
|
|
375
416
|
/**
|
|
376
417
|
* Calculate average signal value with default
|
|
377
418
|
*/
|
|
@@ -384,18 +425,10 @@ export declare class TrustEngine extends EventEmitter {
|
|
|
384
425
|
* Create initial trust record
|
|
385
426
|
*/
|
|
386
427
|
private createInitialRecord;
|
|
387
|
-
/**
|
|
388
|
-
* Check if accelerated decay is currently active for an entity
|
|
389
|
-
*/
|
|
390
|
-
isAcceleratedDecayActive(entityId: ID): boolean;
|
|
391
428
|
/**
|
|
392
429
|
* Check if accelerated recovery is currently active for an entity
|
|
393
430
|
*/
|
|
394
431
|
isAcceleratedRecoveryActive(entityId: ID): boolean;
|
|
395
|
-
/**
|
|
396
|
-
* Get current failure count for an entity
|
|
397
|
-
*/
|
|
398
|
-
getFailureCount(entityId: ID): number;
|
|
399
432
|
/**
|
|
400
433
|
* Get consecutive success count for an entity
|
|
401
434
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trust-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,EAAE,EACH,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trust-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACV,WAAW,EACX,eAAe,EACf,EAAE,EACH,MAAM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