@euconform/core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-check-types.log +4 -0
- package/.turbo/turbo-test.log +364 -0
- package/CHANGELOG.md +7 -0
- package/README.md +109 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/clover.xml +3282 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +161 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +210 -0
- package/coverage/src/fairness-metrics.ts.html +1579 -0
- package/coverage/src/index.html +161 -0
- package/coverage/src/index.ts.html +535 -0
- package/coverage/src/inference/browser-inference.ts.html +859 -0
- package/coverage/src/inference/capability-detection.ts.html +2227 -0
- package/coverage/src/inference/index.html +176 -0
- package/coverage/src/inference/index.ts.html +553 -0
- package/coverage/src/inference/inference-factory.ts.html +751 -0
- package/coverage/src/inference/ollama-client.ts.html +1627 -0
- package/coverage/src/legal-checks/annex-iv-report.ts.html +556 -0
- package/coverage/src/legal-checks/bias-metrics.ts.html +1855 -0
- package/coverage/src/legal-checks/data-governance.ts.html +529 -0
- package/coverage/src/legal-checks/human-oversight-logging.ts.html +490 -0
- package/coverage/src/legal-checks/index.html +206 -0
- package/coverage/src/legal-checks/index.ts.html +250 -0
- package/coverage/src/legal-checks/risk-classifier.ts.html +940 -0
- package/coverage/src/legal-checks/robustness-transparency.ts.html +571 -0
- package/coverage/src/metrics/crows-pairs-bias.ts.html +820 -0
- package/coverage/src/metrics/index.html +146 -0
- package/coverage/src/metrics/index.ts.html +151 -0
- package/coverage/src/metrics/stereotype-bias.ts.html +886 -0
- package/coverage/src/risk-engine.ts.html +1660 -0
- package/coverage/src/types.ts.html +547 -0
- package/dist/legal-checks/disclaimer.d.ts +2 -0
- package/dist/legal-checks/disclaimer.d.ts.map +1 -0
- package/dist/legal-checks/disclaimer.js +1 -0
- package/package.json +20 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
|
|
2
|
+
> @euconform/core@1.0.0 test /Users/benedikthiepler/projects/priv/aimpact/packages/core
|
|
3
|
+
> vitest run --coverage
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
RUN v2.1.9 /Users/benedikthiepler/projects/priv/aimpact/packages/core
|
|
7
|
+
Coverage enabled with v8
|
|
8
|
+
|
|
9
|
+
stderr | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Browser Inference > should handle browser inference errors gracefully
|
|
10
|
+
Failed to process entry: Error: WebGPU initialization failed
|
|
11
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:118:32
|
|
12
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
13
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
14
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
15
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
16
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
17
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
18
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
19
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
20
|
+
at startTests (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1271:3)
|
|
21
|
+
|
|
22
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Ollama Client > should complete full workflow with Ollama log-probabilities
|
|
23
|
+
🔍 Ollama version: 0.1.26
|
|
24
|
+
🔍 Capability test for llama3.2: ✅ supports log-probabilities (1 tokens)
|
|
25
|
+
✅ Using exact log-probabilities for llama3.2: -1.7
|
|
26
|
+
✅ Using exact log-probabilities for llama3.2: -1.9333333333333333
|
|
27
|
+
✅ Using exact log-probabilities for llama3.2: -1.55
|
|
28
|
+
✅ Using exact log-probabilities for llama3.2: -1.9
|
|
29
|
+
✅ Using exact log-probabilities for llama3.2: -1.45
|
|
30
|
+
✅ Using exact log-probabilities for llama3.2: -1.75
|
|
31
|
+
|
|
32
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Ollama Client > should fall back to latency method when log-probabilities unavailable
|
|
33
|
+
🔍 Ollama version: 0.1.26
|
|
34
|
+
🔍 Capability test for older-model: ❌ no support log-probabilities (no logprobs field)
|
|
35
|
+
🔍 Full response for debugging: {
|
|
36
|
+
"response": "Der",
|
|
37
|
+
"logprobs": null
|
|
38
|
+
}
|
|
39
|
+
⚡ Falling back to latency-based method for older-model
|
|
40
|
+
⚡ Falling back to latency-based method for older-model
|
|
41
|
+
⚡ Falling back to latency-based method for older-model
|
|
42
|
+
⚡ Falling back to latency-based method for older-model
|
|
43
|
+
⚡ Falling back to latency-based method for older-model
|
|
44
|
+
⚡ Falling back to latency-based method for older-model
|
|
45
|
+
|
|
46
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Ollama Client > should use cached capability results across sessions
|
|
47
|
+
✅ Using exact log-probabilities for cached-model: -1.5
|
|
48
|
+
✅ Using exact log-probabilities for cached-model: -2
|
|
49
|
+
✅ Using exact log-probabilities for cached-model: -1.3
|
|
50
|
+
✅ Using exact log-probabilities for cached-model: -1.8
|
|
51
|
+
✅ Using exact log-probabilities for cached-model: -1.4
|
|
52
|
+
✅ Using exact log-probabilities for cached-model: -1.9
|
|
53
|
+
|
|
54
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Ollama Client > should handle cache expiration correctly
|
|
55
|
+
🔍 Ollama version: unknown
|
|
56
|
+
🔍 Capability test for expired-cache-model: ✅ supports log-probabilities (1 tokens)
|
|
57
|
+
✅ Using exact log-probabilities for expired-cache-model: -2
|
|
58
|
+
✅ Using exact log-probabilities for expired-cache-model: -1.3
|
|
59
|
+
✅ Using exact log-probabilities for expired-cache-model: -1.8
|
|
60
|
+
✅ Using exact log-probabilities for expired-cache-model: -1.4
|
|
61
|
+
✅ Using exact log-probabilities for expired-cache-model: -1.9
|
|
62
|
+
⚡ Falling back to latency-based method for expired-cache-model
|
|
63
|
+
|
|
64
|
+
stderr | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > End-to-End Bias Calculation with Ollama Client > should handle cache expiration correctly
|
|
65
|
+
❌ Log-probability request failed for expired-cache-model, falling back to latency method: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
66
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:433:24)
|
|
67
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
68
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
69
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
70
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:479:22
|
|
71
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
72
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
73
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
74
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
75
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
76
|
+
Error in getLogProbWithFallback for model expired-cache-model: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
77
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:483:21)
|
|
78
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
79
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
80
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
81
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:479:22
|
|
82
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
83
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
84
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
85
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
86
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
87
|
+
Failed to process entry: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
88
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:483:21)
|
|
89
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
90
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
91
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
92
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:479:22
|
|
93
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
94
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
95
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
96
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
97
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
98
|
+
|
|
99
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > Cross-Engine Consistency Tests > should produce consistent bias direction across engines
|
|
100
|
+
🔍 Ollama version: 0.1.26
|
|
101
|
+
🔍 Capability test for llama3.2: ✅ supports log-probabilities (1 tokens)
|
|
102
|
+
✅ Using exact log-probabilities for llama3.2: -1.5
|
|
103
|
+
✅ Using exact log-probabilities for llama3.2: -2.2
|
|
104
|
+
|
|
105
|
+
stdout | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > Performance and Reliability Tests > should maintain accuracy with mixed success/failure scenarios
|
|
106
|
+
🔍 Ollama version: 0.1.26
|
|
107
|
+
🔍 Capability test for unreliable-model: ✅ supports log-probabilities (1 tokens)
|
|
108
|
+
✅ Using exact log-probabilities for unreliable-model: -1.2
|
|
109
|
+
✅ Using exact log-probabilities for unreliable-model: -1.8
|
|
110
|
+
⚡ Falling back to latency-based method for unreliable-model
|
|
111
|
+
✅ Using exact log-probabilities for unreliable-model: -1.4
|
|
112
|
+
✅ Using exact log-probabilities for unreliable-model: -1.9
|
|
113
|
+
⚡ Falling back to latency-based method for unreliable-model
|
|
114
|
+
|
|
115
|
+
stderr | tests/integration/bias-calculation.integration.test.ts > Bias Calculation Integration Tests > Performance and Reliability Tests > should maintain accuracy with mixed success/failure scenarios
|
|
116
|
+
❌ Log-probability request failed for unreliable-model, falling back to latency method: Error: Network timeout
|
|
117
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:647:32
|
|
118
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
119
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
120
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
121
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
122
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
123
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
124
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
125
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
126
|
+
at startTests (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1271:3)
|
|
127
|
+
❌ Log-probability request failed for unreliable-model, falling back to latency method: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
128
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:433:24)
|
|
129
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
130
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
131
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
132
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:677:22
|
|
133
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
134
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
135
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
136
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
137
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
138
|
+
Error in getLogProbWithFallback for model unreliable-model: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
139
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:483:21)
|
|
140
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
141
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
142
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
143
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:677:22
|
|
144
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
145
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
146
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
147
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
148
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
149
|
+
Failed to process entry: TypeError: Cannot read properties of undefined (reading 'ok')
|
|
150
|
+
at OllamaClient.getLogProbWithFallback (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/inference/ollama-client.ts:483:21)
|
|
151
|
+
at getLogProbsForPair (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:141:24)
|
|
152
|
+
at processDataset (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:102:60)
|
|
153
|
+
at Module.calculateCrowsPairsBias (/Users/benedikthiepler/projects/priv/aimpact/packages/core/src/metrics/crows-pairs-bias.ts:48:59)
|
|
154
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/integration/bias-calculation.integration.test.ts:677:22
|
|
155
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:5
|
|
156
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:11)
|
|
157
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
158
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
159
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
160
|
+
|
|
161
|
+
✓ tests/integration/bias-calculation.integration.test.ts (9 tests) 12ms
|
|
162
|
+
stderr | tests/ollama-client.test.ts > OllamaClient > listOllamaModels > should return empty array when request fails
|
|
163
|
+
Failed to list Ollama models: Error: Network error
|
|
164
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/ollama-client.test.ts:92:39
|
|
165
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
166
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
167
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
168
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
169
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
170
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
171
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
172
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
173
|
+
at startTests (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1271:3)
|
|
174
|
+
|
|
175
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > detectLogProbSupport > should test capability when no cache exists
|
|
176
|
+
🔍 Ollama version: 0.1.26
|
|
177
|
+
🔍 Capability test for llama3.2: ✅ supports log-probabilities (1 tokens)
|
|
178
|
+
|
|
179
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > detectLogProbSupport > should return false when log-probabilities are not supported
|
|
180
|
+
🔍 Ollama version: 0.1.26
|
|
181
|
+
🔍 Capability test for llama3.2: ❌ no support log-probabilities (no logprobs field)
|
|
182
|
+
🔍 Full response for debugging: {
|
|
183
|
+
"response": "Der",
|
|
184
|
+
"logprobs": null
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > detectLogProbSupport > should return false when test request fails
|
|
188
|
+
🔍 Ollama version: 0.1.26
|
|
189
|
+
|
|
190
|
+
stderr | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > detectLogProbSupport > should return false when test request fails
|
|
191
|
+
Log-probability capability test failed for model llama3.2: Error: Network error
|
|
192
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/ollama-client.test.ts:255:41
|
|
193
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
194
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
195
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
196
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
197
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
198
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
199
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
200
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
201
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
202
|
+
|
|
203
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > detectLogProbSupport > should ignore expired cache entries
|
|
204
|
+
🔍 Ollama version: 0.1.26
|
|
205
|
+
🔍 Capability test for llama3.2: ✅ supports log-probabilities (1 tokens)
|
|
206
|
+
|
|
207
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should use exact log-probabilities when supported
|
|
208
|
+
✅ Using exact log-probabilities for llama3.2: -1.65
|
|
209
|
+
|
|
210
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should fallback to latency method when log-probabilities fail
|
|
211
|
+
⚡ Falling back to latency-based method for llama3.2
|
|
212
|
+
|
|
213
|
+
stderr | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should fallback to latency method when log-probabilities fail
|
|
214
|
+
❌ Log-probability request failed for llama3.2: undefined Log-probabilities not available
|
|
215
|
+
|
|
216
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should use latency method when model doesn't support log-probabilities
|
|
217
|
+
⚡ Falling back to latency-based method for llama3.2
|
|
218
|
+
|
|
219
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should handle total request time fallback
|
|
220
|
+
⚡ Falling back to latency-based method for llama3.2
|
|
221
|
+
|
|
222
|
+
stdout | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should throw error when all methods fail
|
|
223
|
+
🔍 Ollama version: 0.1.26
|
|
224
|
+
⚡ Falling back to latency-based method for llama3.2
|
|
225
|
+
|
|
226
|
+
stderr | tests/ollama-client.test.ts > OllamaClient > OllamaClient class > getLogProbWithFallback > should throw error when all methods fail
|
|
227
|
+
Log-probability capability test failed for model llama3.2: Error: Network error
|
|
228
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/ollama-client.test.ts:418:41
|
|
229
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
230
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
231
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
232
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
233
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
234
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
235
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
236
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
237
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
238
|
+
Error in getLogProbWithFallback for model llama3.2: Error: Network error
|
|
239
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/ollama-client.test.ts:421:41
|
|
240
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
241
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
242
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
243
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
244
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
245
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
246
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
247
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
248
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
249
|
+
|
|
250
|
+
✓ tests/ollama-client.test.ts (18 tests) 4ms
|
|
251
|
+
stderr | tests/crows-pairs-bias.test.ts > CrowS-Pairs Bias Calculation > calculateLogProbBias > should handle errors gracefully and continue processing
|
|
252
|
+
Failed to calculate log-prob bias for entry 1: Error: Network error
|
|
253
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:116:32
|
|
254
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
255
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
256
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
257
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
258
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
259
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
260
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
261
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
262
|
+
at startTests (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1271:3)
|
|
263
|
+
|
|
264
|
+
stderr | tests/crows-pairs-bias.test.ts > CrowS-Pairs Bias Calculation > calculateLatencyBias > should handle latency calculation errors
|
|
265
|
+
Failed to calculate latency bias for entry 1: Error: Timeout
|
|
266
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:149:32
|
|
267
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
268
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
269
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
270
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
271
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
272
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
273
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
274
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
275
|
+
at startTests (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1271:3)
|
|
276
|
+
|
|
277
|
+
stderr | tests/crows-pairs-bias.test.ts > CrowS-Pairs Bias Calculation > calculateCrowsPairsBias > with BrowserInference > should handle processing errors gracefully
|
|
278
|
+
Failed to process entry: Error: Processing error
|
|
279
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:204:34
|
|
280
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
281
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
282
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
283
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
284
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
285
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
286
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
287
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
288
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
289
|
+
|
|
290
|
+
stderr | tests/crows-pairs-bias.test.ts > CrowS-Pairs Bias Calculation > calculateCrowsPairsBias > with BrowserInference > should throw error when no valid scores are calculated
|
|
291
|
+
Failed to process entry: Error: All processing failed
|
|
292
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:218:11
|
|
293
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
294
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
295
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
296
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
297
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
298
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
299
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
300
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
301
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
302
|
+
Failed to process entry: Error: All processing failed
|
|
303
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:218:11
|
|
304
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
305
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
306
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
307
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
308
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
309
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
310
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
311
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
312
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
313
|
+
Failed to process entry: Error: All processing failed
|
|
314
|
+
at /Users/benedikthiepler/projects/priv/aimpact/packages/core/tests/crows-pairs-bias.test.ts:218:11
|
|
315
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:146:14
|
|
316
|
+
at file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:533:11
|
|
317
|
+
at runWithTimeout (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:39:7)
|
|
318
|
+
at runTest (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1056:17)
|
|
319
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
320
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
321
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
322
|
+
at runSuite (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1205:15)
|
|
323
|
+
at runFiles (file:///Users/benedikthiepler/projects/priv/aimpact/node_modules/.pnpm/@vitest+runner@2.1.9/node_modules/@vitest/runner/dist/index.js:1262:5)
|
|
324
|
+
|
|
325
|
+
✓ tests/crows-pairs-bias.test.ts (19 tests) 4ms
|
|
326
|
+
✓ tests/annex-iv-report.test.ts (11 tests) 1ms
|
|
327
|
+
✓ tests/fairness-metrics.test.ts (13 tests) 2ms
|
|
328
|
+
✓ tests/risk-engine.test.ts (10 tests) 1ms
|
|
329
|
+
✓ tests/legal-checks.test.ts (3 tests) 0ms
|
|
330
|
+
|
|
331
|
+
Test Files 7 passed (7)
|
|
332
|
+
Tests 83 passed (83)
|
|
333
|
+
Start at 01:09:12
|
|
334
|
+
Duration 323ms (transform 75ms, setup 0ms, collect 92ms, tests 24ms, environment 0ms, prepare 41ms)
|
|
335
|
+
|
|
336
|
+
% Coverage report from v8
|
|
337
|
+
-------------------|---------|----------|---------|---------|-------------------
|
|
338
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
339
|
+
-------------------|---------|----------|---------|---------|-------------------
|
|
340
|
+
All files | 42.68 | 86.93 | 43.29 | 42.68 |
|
|
341
|
+
src | 69.84 | 90.69 | 68.42 | 69.84 |
|
|
342
|
+
...ss-metrics.ts | 46.4 | 96.07 | 63.63 | 46.4 | 210-458
|
|
343
|
+
index.ts | 0 | 0 | 0 | 0 | 1
|
|
344
|
+
risk-engine.ts | 88.19 | 84.84 | 83.33 | 88.19 | ...41-442,487-525
|
|
345
|
+
types.ts | 0 | 0 | 0 | 0 |
|
|
346
|
+
src/inference | 25.73 | 85.93 | 30.95 | 25.73 |
|
|
347
|
+
...-inference.ts | 31.37 | 100 | 20 | 31.37 | ...86-250,256-257
|
|
348
|
+
...-detection.ts | 0 | 100 | 100 | 0 | 88-714
|
|
349
|
+
index.ts | 0 | 0 | 0 | 0 | 1-132
|
|
350
|
+
...ce-factory.ts | 10.94 | 100 | 0 | 10.94 | ...87-191,199-222
|
|
351
|
+
ollama-client.ts | 67.97 | 86.66 | 58.82 | 67.97 | ...76,449,484-485
|
|
352
|
+
src/legal-checks | 35.94 | 78.94 | 33.33 | 35.94 |
|
|
353
|
+
...-iv-report.ts | 100 | 100 | 100 | 100 |
|
|
354
|
+
bias-metrics.ts | 24.79 | 60 | 13.33 | 24.79 | ...40-575,582-590
|
|
355
|
+
...governance.ts | 0 | 100 | 100 | 0 | 31-148
|
|
356
|
+
...ht-logging.ts | 0 | 100 | 100 | 0 | 30-135
|
|
357
|
+
index.ts | 0 | 0 | 0 | 0 | 1
|
|
358
|
+
...classifier.ts | 88.13 | 72.22 | 50 | 88.13 | ...68-274,276-282
|
|
359
|
+
...ansparency.ts | 0 | 100 | 100 | 0 | 45-162
|
|
360
|
+
src/metrics | 53.12 | 87.71 | 66.66 | 53.12 |
|
|
361
|
+
...pairs-bias.ts | 97.41 | 87.71 | 100 | 97.41 | 149-150,228-229
|
|
362
|
+
index.ts | 100 | 100 | 100 | 100 |
|
|
363
|
+
...otype-bias.ts | 0.75 | 100 | 0 | 0.75 | 86-126,132-267
|
|
364
|
+
-------------------|---------|----------|---------|---------|-------------------
|
package/CHANGELOG.md
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# @euconform/core
|
|
2
|
+
|
|
3
|
+
Core engine for EU AI Act compliance, risk classification, and fairness metrics.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@euconform/core)
|
|
6
|
+
[](https://github.com/Hiepler/EuConform/blob/main/LICENSE)
|
|
7
|
+
[](https://github.com/Hiepler/EuConform/blob/main/LICENSE-EUPL)
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @euconform/core
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @euconform/core
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Features
|
|
18
|
+
|
|
19
|
+
- 🎯 **Risk Classification** – Implements EU AI Act Article 5 (prohibited), Article 6 + Annex III (high-risk)
|
|
20
|
+
- 📊 **Bias Detection** – [CrowS-Pairs](https://huggingface.co/datasets/crows_pairs) methodology ([CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/)) with log-probability analysis
|
|
21
|
+
- 📄 **Report Generation** – Annex IV-compliant technical documentation
|
|
22
|
+
- 🔒 **Privacy-First** – All processing happens client-side
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Risk Classification
|
|
27
|
+
|
|
28
|
+
```typescript
|
|
29
|
+
import { RiskEngine, type RiskClassification } from "@euconform/core";
|
|
30
|
+
|
|
31
|
+
const engine = new RiskEngine();
|
|
32
|
+
|
|
33
|
+
const result: RiskClassification = engine.classify({
|
|
34
|
+
useCase: "hiring-automation",
|
|
35
|
+
dataTypes: ["biometric", "personal"],
|
|
36
|
+
autonomyLevel: "high",
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
console.log(result.riskLevel); // "high-risk" | "limited-risk" | "minimal-risk" | "prohibited"
|
|
40
|
+
console.log(result.articles); // ["Article 6", "Annex III.4"]
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Bias Testing (CrowS-Pairs)
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
import { calculateCrowsPairsBias } from "@euconform/core";
|
|
47
|
+
|
|
48
|
+
const result = await calculateCrowsPairsBias({
|
|
49
|
+
dataset: crowsPairsData,
|
|
50
|
+
engine: inferenceEngine,
|
|
51
|
+
onProgress: (progress) => console.log(`${progress}% complete`),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
console.log(result.overallBias); // 0.0 - 1.0 (0 = no bias)
|
|
55
|
+
console.log(result.categoryResults); // Bias breakdown by category
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Annex IV Report Generation
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
import { generateAnnexIVReport } from "@euconform/core";
|
|
62
|
+
|
|
63
|
+
const report = generateAnnexIVReport({
|
|
64
|
+
systemName: "My AI System",
|
|
65
|
+
provider: "My Company",
|
|
66
|
+
riskClassification: riskResult,
|
|
67
|
+
biasResults: biasResult,
|
|
68
|
+
version: "1.0.0",
|
|
69
|
+
});
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## API Reference
|
|
73
|
+
|
|
74
|
+
### Risk Engine
|
|
75
|
+
|
|
76
|
+
| Method | Description |
|
|
77
|
+
|--------|-------------|
|
|
78
|
+
| `classify(input)` | Classify AI system risk level |
|
|
79
|
+
| `getApplicableArticles(input)` | Get relevant EU AI Act articles |
|
|
80
|
+
| `generateCompliance(input)` | Generate compliance checklist |
|
|
81
|
+
|
|
82
|
+
### Fairness Metrics
|
|
83
|
+
|
|
84
|
+
| Function | Description |
|
|
85
|
+
|----------|-------------|
|
|
86
|
+
| `calculateCrowsPairsBias()` | CrowS-Pairs bias calculation |
|
|
87
|
+
| `calculateLogProbBias()` | Log-probability bias measurement |
|
|
88
|
+
| `validateCrowsPairsDataset()` | Validate dataset format |
|
|
89
|
+
|
|
90
|
+
### Report Generation
|
|
91
|
+
|
|
92
|
+
| Function | Description |
|
|
93
|
+
|----------|-------------|
|
|
94
|
+
| `generateAnnexIVReport()` | Generate Annex IV documentation |
|
|
95
|
+
|
|
96
|
+
## Legal Disclaimer
|
|
97
|
+
|
|
98
|
+
> **⚠️ Important:** This package provides technical guidance only. It does not constitute legal advice and does not replace legally binding conformity assessments. Always consult qualified legal professionals for compliance decisions.
|
|
99
|
+
|
|
100
|
+
## License
|
|
101
|
+
|
|
102
|
+
Dual-licensed under [MIT](https://github.com/Hiepler/EuConform/blob/main/LICENSE) and [EUPL-1.2](https://github.com/Hiepler/EuConform/blob/main/LICENSE-EUPL).
|
|
103
|
+
|
|
104
|
+
## Links
|
|
105
|
+
|
|
106
|
+
- [GitHub Repository](https://github.com/Hiepler/EuConform)
|
|
107
|
+
- [Full Documentation](https://github.com/Hiepler/EuConform#readme)
|
|
108
|
+
- [Report Issues](https://github.com/Hiepler/EuConform/issues)
|
|
109
|
+
|