@euconform/core 1.0.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +1 -1
- package/CHANGELOG.md +12 -0
- package/dist/evidence/bundle.d.ts +23 -0
- package/dist/evidence/bundle.d.ts.map +1 -0
- package/dist/evidence/bundle.js +44 -0
- package/dist/evidence/compliance-evaluation.d.ts +12 -0
- package/dist/evidence/compliance-evaluation.d.ts.map +1 -0
- package/dist/evidence/compliance-evaluation.js +78 -0
- package/dist/evidence/hash.d.ts +2 -0
- package/dist/evidence/hash.d.ts.map +1 -0
- package/dist/evidence/hash.js +4 -0
- package/dist/evidence/index.d.ts +13 -0
- package/dist/evidence/index.d.ts.map +1 -0
- package/dist/evidence/index.js +11 -0
- package/dist/evidence/markdown.d.ts +9 -0
- package/dist/evidence/markdown.d.ts.map +1 -0
- package/dist/evidence/markdown.js +169 -0
- package/dist/evidence/output.d.ts +13 -0
- package/dist/evidence/output.d.ts.map +1 -0
- package/dist/evidence/output.js +547 -0
- package/dist/evidence/types.d.ts +230 -0
- package/dist/evidence/types.d.ts.map +1 -0
- package/dist/evidence/types.js +7 -0
- package/dist/evidence/validate.d.ts +8 -0
- package/dist/evidence/validate.d.ts.map +1 -0
- package/dist/evidence/validate.js +175 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/inference/ollama-client.d.ts +3 -0
- package/dist/inference/ollama-client.d.ts.map +1 -1
- package/dist/inference/ollama-client.js +69 -71
- package/dist/legal-checks/annex-iv-report.d.ts +3 -0
- package/dist/legal-checks/annex-iv-report.d.ts.map +1 -1
- package/dist/legal-checks/annex-iv-report.js +1 -0
- package/dist/legal-checks/deadline-timeline.d.ts +57 -0
- package/dist/legal-checks/deadline-timeline.d.ts.map +1 -0
- package/dist/legal-checks/deadline-timeline.js +265 -0
- package/dist/legal-checks/gap-analysis.d.ts +48 -0
- package/dist/legal-checks/gap-analysis.d.ts.map +1 -0
- package/dist/legal-checks/gap-analysis.js +397 -0
- package/dist/legal-checks/gpai-classifier.d.ts +49 -0
- package/dist/legal-checks/gpai-classifier.d.ts.map +1 -0
- package/dist/legal-checks/gpai-classifier.js +197 -0
- package/dist/legal-checks/index.d.ts +6 -0
- package/dist/legal-checks/index.d.ts.map +1 -1
- package/dist/legal-checks/index.js +3 -0
- package/dist/scanner/aggregator.d.ts +7 -0
- package/dist/scanner/aggregator.d.ts.map +1 -0
- package/dist/scanner/aggregator.js +200 -0
- package/dist/scanner/detectors/ai-framework-detector.d.ts +3 -0
- package/dist/scanner/detectors/ai-framework-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/ai-framework-detector.js +74 -0
- package/dist/scanner/detectors/ai-provider-detector.d.ts +3 -0
- package/dist/scanner/detectors/ai-provider-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/ai-provider-detector.js +100 -0
- package/dist/scanner/detectors/compliance-detector.d.ts +3 -0
- package/dist/scanner/detectors/compliance-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/compliance-detector.js +201 -0
- package/dist/scanner/detectors/config-detector.d.ts +3 -0
- package/dist/scanner/detectors/config-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/config-detector.js +248 -0
- package/dist/scanner/detectors/framework-detector.d.ts +3 -0
- package/dist/scanner/detectors/framework-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/framework-detector.js +141 -0
- package/dist/scanner/detectors/index.d.ts +8 -0
- package/dist/scanner/detectors/index.d.ts.map +1 -0
- package/dist/scanner/detectors/index.js +37 -0
- package/dist/scanner/detectors/local-inference-detector.d.ts +3 -0
- package/dist/scanner/detectors/local-inference-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/local-inference-detector.js +93 -0
- package/dist/scanner/detectors/markdown-detector.d.ts +3 -0
- package/dist/scanner/detectors/markdown-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/markdown-detector.js +139 -0
- package/dist/scanner/detectors/package-json-detector.d.ts +3 -0
- package/dist/scanner/detectors/package-json-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/package-json-detector.js +166 -0
- package/dist/scanner/detectors/rag-detector.d.ts +3 -0
- package/dist/scanner/detectors/rag-detector.d.ts.map +1 -0
- package/dist/scanner/detectors/rag-detector.js +132 -0
- package/dist/scanner/detectors/shared.d.ts +18 -0
- package/dist/scanner/detectors/shared.d.ts.map +1 -0
- package/dist/scanner/detectors/shared.js +36 -0
- package/dist/scanner/discovery.d.ts +14 -0
- package/dist/scanner/discovery.d.ts.map +1 -0
- package/dist/scanner/discovery.js +235 -0
- package/dist/scanner/index.d.ts +9 -0
- package/dist/scanner/index.d.ts.map +1 -0
- package/dist/scanner/index.js +8 -0
- package/package.json +6 -3
- package/src/evidence/bundle.ts +65 -0
- package/src/evidence/compliance-evaluation.ts +114 -0
- package/src/evidence/hash.ts +5 -0
- package/src/evidence/index.ts +51 -0
- package/src/evidence/markdown.ts +226 -0
- package/src/evidence/output.ts +717 -0
- package/src/evidence/types.ts +329 -0
- package/src/evidence/validate.ts +270 -0
- package/src/index.ts +25 -0
- package/src/inference/ollama-client.ts +93 -86
- package/src/legal-checks/annex-iv-report.ts +4 -0
- package/src/legal-checks/deadline-timeline.ts +313 -0
- package/src/legal-checks/gap-analysis.ts +454 -0
- package/src/legal-checks/gpai-classifier.ts +281 -0
- package/src/legal-checks/index.ts +33 -0
- package/src/scanner/aggregator.ts +258 -0
- package/src/scanner/detectors/ai-framework-detector.ts +94 -0
- package/src/scanner/detectors/ai-provider-detector.ts +135 -0
- package/src/scanner/detectors/compliance-detector.ts +232 -0
- package/src/scanner/detectors/config-detector.ts +316 -0
- package/src/scanner/detectors/framework-detector.ts +163 -0
- package/src/scanner/detectors/index.ts +40 -0
- package/src/scanner/detectors/local-inference-detector.ts +124 -0
- package/src/scanner/detectors/markdown-detector.ts +176 -0
- package/src/scanner/detectors/package-json-detector.ts +202 -0
- package/src/scanner/detectors/rag-detector.ts +162 -0
- package/src/scanner/detectors/shared.ts +45 -0
- package/src/scanner/discovery.ts +290 -0
- package/src/scanner/index.ts +9 -0
- package/tests/evidence/bundle.test.ts +128 -0
- package/tests/evidence/ecef-schemas.test.ts +316 -0
- package/tests/evidence/hash.test.ts +25 -0
- package/tests/evidence/markdown.test.ts +92 -0
- package/tests/evidence/output.test.ts +203 -0
- package/tests/fixtures/compliance-good/README.md +14 -0
- package/tests/fixtures/compliance-good/lib/ai-service.ts +17 -0
- package/tests/fixtures/compliance-good/lib/review-flow.ts +11 -0
- package/tests/fixtures/compliance-good/package.json +10 -0
- package/tests/fixtures/compliance-good/tests/bias-check.test.ts +13 -0
- package/tests/fixtures/nextjs-openai/README.md +5 -0
- package/tests/fixtures/nextjs-openai/app/page.tsx +11 -0
- package/tests/fixtures/nextjs-openai/package.json +9 -0
- package/tests/fixtures/ollama-rag/.env.example +2 -0
- package/tests/fixtures/ollama-rag/docker-compose.yml +9 -0
- package/tests/fixtures/ollama-rag/package.json +9 -0
- package/tests/fixtures/ollama-rag/server.ts +21 -0
- package/tests/fixtures/plain-webapp/README.md +3 -0
- package/tests/fixtures/plain-webapp/index.js +5 -0
- package/tests/fixtures/plain-webapp/package.json +8 -0
- package/tests/gpai-classifier.test.ts +125 -0
- package/tests/gpai-timeline.test.ts +55 -0
- package/tests/scanner/aggregator.test.ts +122 -0
- package/tests/scanner/detectors.test.ts +274 -0
- package/tests/scanner/discovery.test.ts +87 -0
- package/vitest.config.ts +1 -0
- package/.turbo/turbo-check-types.log +0 -4
- package/.turbo/turbo-test.log +0 -364
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -3282
- package/coverage/coverage-final.json +0 -20
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -161
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/src/fairness-metrics.ts.html +0 -1579
- package/coverage/src/index.html +0 -161
- package/coverage/src/index.ts.html +0 -535
- package/coverage/src/inference/browser-inference.ts.html +0 -859
- package/coverage/src/inference/capability-detection.ts.html +0 -2227
- package/coverage/src/inference/index.html +0 -176
- package/coverage/src/inference/index.ts.html +0 -553
- package/coverage/src/inference/inference-factory.ts.html +0 -751
- package/coverage/src/inference/ollama-client.ts.html +0 -1627
- package/coverage/src/legal-checks/annex-iv-report.ts.html +0 -556
- package/coverage/src/legal-checks/bias-metrics.ts.html +0 -1855
- package/coverage/src/legal-checks/data-governance.ts.html +0 -529
- package/coverage/src/legal-checks/human-oversight-logging.ts.html +0 -490
- package/coverage/src/legal-checks/index.html +0 -206
- package/coverage/src/legal-checks/index.ts.html +0 -250
- package/coverage/src/legal-checks/risk-classifier.ts.html +0 -940
- package/coverage/src/legal-checks/robustness-transparency.ts.html +0 -571
- package/coverage/src/metrics/crows-pairs-bias.ts.html +0 -820
- package/coverage/src/metrics/index.html +0 -146
- package/coverage/src/metrics/index.ts.html +0 -151
- package/coverage/src/metrics/stereotype-bias.ts.html +0 -886
- package/coverage/src/risk-engine.ts.html +0 -1660
- package/coverage/src/types.ts.html +0 -547
- package/dist/legal-checks/disclaimer.d.ts +0 -2
- package/dist/legal-checks/disclaimer.d.ts.map +0 -1
- package/dist/legal-checks/disclaimer.js +0 -1
|
@@ -147,6 +147,9 @@ export class OllamaClient {
|
|
|
147
147
|
this.model = model;
|
|
148
148
|
this.capabilityCache = new Map();
|
|
149
149
|
}
|
|
150
|
+
isCloudModel() {
|
|
151
|
+
return this.model.includes(":cloud");
|
|
152
|
+
}
|
|
150
153
|
/**
|
|
151
154
|
* Ensures the model is available in Ollama before proceeding
|
|
152
155
|
* Throws an error if the model is not found
|
|
@@ -185,6 +188,11 @@ export class OllamaClient {
|
|
|
185
188
|
* Sends a test request with "Der" prompt to detect capability
|
|
186
189
|
*/
|
|
187
190
|
async testLogProbCapability() {
|
|
191
|
+
// Cloud models (via Ollama proxy) don't support logprobs parameter
|
|
192
|
+
if (this.isCloudModel()) {
|
|
193
|
+
console.log(`🔍 ${this.model} is a cloud model - logprobs not supported, using latency method`);
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
188
196
|
try {
|
|
189
197
|
// First check Ollama version
|
|
190
198
|
try {
|
|
@@ -292,55 +300,11 @@ export class OllamaClient {
|
|
|
292
300
|
this.setCachedCapability(supports);
|
|
293
301
|
return supports;
|
|
294
302
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
async getLogProbWithFallback(prompt) {
|
|
303
|
+
async tryExactLogProbs(prompt) {
|
|
304
|
+
const supportsLogProbs = await this.detectLogProbSupport();
|
|
305
|
+
if (!supportsLogProbs || this.isCloudModel())
|
|
306
|
+
return null;
|
|
300
307
|
try {
|
|
301
|
-
// First, check if model supports log-probabilities
|
|
302
|
-
const supportsLogProbs = await this.detectLogProbSupport();
|
|
303
|
-
if (supportsLogProbs) {
|
|
304
|
-
// Try to get exact log-probabilities
|
|
305
|
-
try {
|
|
306
|
-
const response = await fetch(`${this.baseUrl}/api/generate`, {
|
|
307
|
-
method: "POST",
|
|
308
|
-
headers: { "Content-Type": "application/json" },
|
|
309
|
-
body: JSON.stringify({
|
|
310
|
-
model: this.model,
|
|
311
|
-
prompt,
|
|
312
|
-
stream: false,
|
|
313
|
-
logprobs: true,
|
|
314
|
-
options: {
|
|
315
|
-
num_predict: 0, // Only evaluate prompt, don't generate
|
|
316
|
-
temperature: 0,
|
|
317
|
-
},
|
|
318
|
-
}),
|
|
319
|
-
});
|
|
320
|
-
if (response.ok) {
|
|
321
|
-
const data = await response.json();
|
|
322
|
-
if (data.logprobs && Array.isArray(data.logprobs) && data.logprobs.length > 0) {
|
|
323
|
-
// Calculate average log-probability across all tokens
|
|
324
|
-
const avgLogProb = data.logprobs.reduce((sum, item) => sum + item.logprob, 0) / data.logprobs.length;
|
|
325
|
-
console.log(`✅ Using exact log-probabilities for ${this.model}: ${avgLogProb}`);
|
|
326
|
-
return {
|
|
327
|
-
logprob: avgLogProb,
|
|
328
|
-
method: "logprobs_exact",
|
|
329
|
-
};
|
|
330
|
-
}
|
|
331
|
-
console.warn(`❌ No logprobs in response for ${this.model}, response:`, data);
|
|
332
|
-
}
|
|
333
|
-
else {
|
|
334
|
-
console.warn(`❌ Log-probability request failed for ${this.model}: ${response.status} ${response.statusText}`);
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
catch (error) {
|
|
338
|
-
console.warn(`❌ Log-probability request failed for ${this.model}, falling back to latency method:`, error);
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
// Fallback to latency-based method
|
|
342
|
-
console.log(`⚡ Falling back to latency-based method for ${this.model}`);
|
|
343
|
-
const startTime = performance.now();
|
|
344
308
|
const response = await fetch(`${this.baseUrl}/api/generate`, {
|
|
345
309
|
method: "POST",
|
|
346
310
|
headers: { "Content-Type": "application/json" },
|
|
@@ -348,35 +312,69 @@ export class OllamaClient {
|
|
|
348
312
|
model: this.model,
|
|
349
313
|
prompt,
|
|
350
314
|
stream: false,
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
temperature: 0,
|
|
354
|
-
},
|
|
315
|
+
logprobs: true,
|
|
316
|
+
options: { num_predict: 0, temperature: 0 },
|
|
355
317
|
}),
|
|
356
318
|
});
|
|
357
|
-
const endTime = performance.now();
|
|
358
319
|
if (!response.ok) {
|
|
359
|
-
|
|
320
|
+
console.warn(`❌ Log-probability request failed for ${this.model}: ${response.status} ${response.statusText}`);
|
|
321
|
+
return null;
|
|
360
322
|
}
|
|
361
323
|
const data = await response.json();
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
// Use prompt evaluation metrics (preferred)
|
|
366
|
-
latency = data.prompt_eval_duration / data.prompt_eval_count / 1e9; // ns to seconds per token
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
369
|
-
// Fallback to total request time
|
|
370
|
-
const totalTime = (endTime - startTime) / 1000; // ms to seconds
|
|
371
|
-
const tokenCount = prompt.split(/\s+/).length; // rough token estimate
|
|
372
|
-
latency = totalTime / Math.max(tokenCount, 1);
|
|
324
|
+
if (!data.logprobs || !Array.isArray(data.logprobs) || data.logprobs.length === 0) {
|
|
325
|
+
console.warn(`❌ No logprobs in response for ${this.model}, response:`, data);
|
|
326
|
+
return null;
|
|
373
327
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
return {
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
};
|
|
328
|
+
const avgLogProb = data.logprobs.reduce((sum, item) => sum + item.logprob, 0) / data.logprobs.length;
|
|
329
|
+
console.log(`✅ Using exact log-probabilities for ${this.model}: ${avgLogProb}`);
|
|
330
|
+
return { logprob: avgLogProb, method: "logprobs_exact" };
|
|
331
|
+
}
|
|
332
|
+
catch (error) {
|
|
333
|
+
console.warn(`❌ Log-probability request failed for ${this.model}, falling back to latency method:`, error);
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
async latencyFallback(prompt) {
|
|
338
|
+
const isCloud = this.isCloudModel();
|
|
339
|
+
console.log(`⚡ Falling back to latency-based method for ${this.model}${isCloud ? " (cloud model)" : ""}`);
|
|
340
|
+
const startTime = performance.now();
|
|
341
|
+
const response = await fetch(`${this.baseUrl}/api/generate`, {
|
|
342
|
+
method: "POST",
|
|
343
|
+
headers: { "Content-Type": "application/json" },
|
|
344
|
+
body: JSON.stringify({
|
|
345
|
+
model: this.model,
|
|
346
|
+
prompt,
|
|
347
|
+
stream: false,
|
|
348
|
+
options: { num_predict: isCloud ? 1 : 0, temperature: 0 },
|
|
349
|
+
}),
|
|
350
|
+
});
|
|
351
|
+
const endTime = performance.now();
|
|
352
|
+
if (!response.ok) {
|
|
353
|
+
const errorText = await response.text();
|
|
354
|
+
throw new Error(`Ollama request failed: ${response.statusText}. ${errorText}`);
|
|
355
|
+
}
|
|
356
|
+
const data = await response.json();
|
|
357
|
+
let latency;
|
|
358
|
+
if (data.prompt_eval_duration && data.prompt_eval_count) {
|
|
359
|
+
latency = data.prompt_eval_duration / data.prompt_eval_count / 1e9;
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
const totalTime = (endTime - startTime) / 1000;
|
|
363
|
+
const tokenCount = prompt.split(/\s+/).length;
|
|
364
|
+
latency = totalTime / Math.max(tokenCount, 1);
|
|
365
|
+
}
|
|
366
|
+
return { logprob: -Math.log(latency + 0.00001), method: "logprobs_fallback_latency" };
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Get log-probability with automatic fallback to latency method
|
|
370
|
+
* Returns both the calculated value and the method used
|
|
371
|
+
*/
|
|
372
|
+
async getLogProbWithFallback(prompt) {
|
|
373
|
+
try {
|
|
374
|
+
const exact = await this.tryExactLogProbs(prompt);
|
|
375
|
+
if (exact)
|
|
376
|
+
return exact;
|
|
377
|
+
return await this.latencyFallback(prompt);
|
|
380
378
|
}
|
|
381
379
|
catch (error) {
|
|
382
380
|
console.error(`Error in getLogProbWithFallback for model ${this.model}:`, error);
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
import type { BiasCalculationMethod, BiasTestResult, RiskLevel } from "../types";
|
|
17
17
|
import type { Citation } from "./bias-metrics";
|
|
18
18
|
import type { DataGovernanceChecklistResult } from "./data-governance";
|
|
19
|
+
import type { GapAnalysisResult } from "./gap-analysis";
|
|
19
20
|
import type { HumanOversightRecommendation } from "./human-oversight-logging";
|
|
20
21
|
import type { AnnexIIIRiskResult } from "./risk-classifier";
|
|
21
22
|
export interface AnnexIVStructuredReportV1 {
|
|
@@ -107,6 +108,7 @@ export interface AnnexIVStructuredReportV1 {
|
|
|
107
108
|
}>;
|
|
108
109
|
references: Citation[];
|
|
109
110
|
};
|
|
111
|
+
section8_gapAnalysis?: GapAnalysisResult;
|
|
110
112
|
}
|
|
111
113
|
export declare function buildAnnexIVReportV1(input: {
|
|
112
114
|
provider: AnnexIVStructuredReportV1["section1_generalDescription"]["provider"];
|
|
@@ -122,6 +124,7 @@ export declare function buildAnnexIVReportV1(input: {
|
|
|
122
124
|
humanOversight?: AnnexIVStructuredReportV1["section6_humanOversight"];
|
|
123
125
|
technicalDocumentation?: Partial<AnnexIVStructuredReportV1["section7_technicalDocumentation"]>;
|
|
124
126
|
biasMethodology?: AnnexIVStructuredReportV1["section5_performanceAndFairness"]["biasMethodology"];
|
|
127
|
+
gapAnalysis?: GapAnalysisResult;
|
|
125
128
|
tool?: {
|
|
126
129
|
name: string;
|
|
127
130
|
version?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annex-iv-report.d.ts","sourceRoot":"","sources":["../../src/legal-checks/annex-iv-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE;QACJ,aAAa,EAAE,aAAa,CAAC;QAC7B,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QACzC,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,EAAE,QAAQ,EAAE,CAAC;QACzB,eAAe,EAAE;YACf,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,KAAK,EAAE,MAAM,EAAE,CAAC;SACjB,CAAC;KACH,CAAC;IACF,2BAA2B,EAAE;QAC3B,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAA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AE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,yBAAyB,CAiD5B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EU AI Act Compliance Deadline Timeline
|
|
3
|
+
* Based on Regulation (EU) 2024/1689, Article 113
|
|
4
|
+
*
|
|
5
|
+
* Non-legal-advice: These dates are extracted from the official regulation text
|
|
6
|
+
* and publicly available EU Commission sources. Always verify with legal counsel.
|
|
7
|
+
*/
|
|
8
|
+
import type { RiskLevel } from "../types";
|
|
9
|
+
export type DeadlineStatus = "past" | "imminent" | "upcoming" | "future";
|
|
10
|
+
export type AffectedAudience = "all" | "prohibited" | "gpai" | "high-annex-iii" | "high-annex-i" | "limited" | "minimal";
|
|
11
|
+
export interface DeadlineObligation {
|
|
12
|
+
titleKey: string;
|
|
13
|
+
articleRef: string;
|
|
14
|
+
audiences: AffectedAudience[];
|
|
15
|
+
maxPenalty?: string;
|
|
16
|
+
proposed?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface DeadlinePhase {
|
|
19
|
+
id: string;
|
|
20
|
+
isoDate: string;
|
|
21
|
+
chapterRef: string;
|
|
22
|
+
titleKey: string;
|
|
23
|
+
subtitleKey: string;
|
|
24
|
+
obligations: DeadlineObligation[];
|
|
25
|
+
status?: DeadlineStatus;
|
|
26
|
+
proposed?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export declare function getDeadlineStatus(isoDate: string, nowMs?: number): DeadlineStatus;
|
|
29
|
+
export declare function getDaysUntilDeadline(isoDate: string, nowMs?: number): number;
|
|
30
|
+
/**
|
|
31
|
+
* EU AI Act Timeline Milestones – Art. 113 Application Schedule
|
|
32
|
+
*
|
|
33
|
+
* Sources:
|
|
34
|
+
* - Regulation (EU) 2024/1689, Article 113
|
|
35
|
+
* - EU Commission AI Act Service Desk: https://ai-act-service-desk.ec.europa.eu
|
|
36
|
+
* - Digital Omnibus Proposal, November 2025 (proposed, not yet law)
|
|
37
|
+
*/
|
|
38
|
+
export declare const EU_AI_ACT_TIMELINE: DeadlinePhase[];
|
|
39
|
+
/**
|
|
40
|
+
* Digital Omnibus proposed changes (November 2025).
|
|
41
|
+
* NOT YET LAW – under negotiation by EP and Council as of early 2026.
|
|
42
|
+
*/
|
|
43
|
+
export declare const DIGITAL_OMNIBUS_PROPOSALS: DeadlinePhase[];
|
|
44
|
+
export declare function getAudiencesForRiskLevel(level: RiskLevel): AffectedAudience[];
|
|
45
|
+
export declare function getNextDeadline(): DeadlinePhase | null;
|
|
46
|
+
export declare function getTimelineForRiskLevel(riskLevel: RiskLevel): (DeadlinePhase & {
|
|
47
|
+
status: DeadlineStatus;
|
|
48
|
+
})[];
|
|
49
|
+
/**
|
|
50
|
+
* Filter timeline phases by explicit audience list.
|
|
51
|
+
* Use this when the caller has audiences that don't map to a RiskLevel
|
|
52
|
+
* (e.g., GPAI providers need ["all", "gpai"]).
|
|
53
|
+
*/
|
|
54
|
+
export declare function getTimelineForAudiences(audiences: AffectedAudience[]): (DeadlinePhase & {
|
|
55
|
+
status: DeadlineStatus;
|
|
56
|
+
})[];
|
|
57
|
+
//# sourceMappingURL=deadline-timeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deadline-timeline.d.ts","sourceRoot":"","sources":["../../src/legal-checks/deadline-timeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzE,MAAM,MAAM,gBAAgB,GACxB,KAAK,GACL,YAAY,GACZ,MAAM,GACN,gBAAgB,GAChB,cAAc,GACd,SAAS,GACT,SAAS,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC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|
+
* Based on Regulation (EU) 2024/1689, Article 113
|
|
4
|
+
*
|
|
5
|
+
* Non-legal-advice: These dates are extracted from the official regulation text
|
|
6
|
+
* and publicly available EU Commission sources. Always verify with legal counsel.
|
|
7
|
+
*/
|
|
8
|
+
const MS_PER_DAY = 1000 * 60 * 60 * 24;
|
|
9
|
+
export function getDeadlineStatus(isoDate, nowMs = Date.now()) {
|
|
10
|
+
const diffDays = (new Date(isoDate).getTime() - nowMs) / MS_PER_DAY;
|
|
11
|
+
if (diffDays < 0)
|
|
12
|
+
return "past";
|
|
13
|
+
if (diffDays <= 90)
|
|
14
|
+
return "imminent";
|
|
15
|
+
if (diffDays <= 365)
|
|
16
|
+
return "upcoming";
|
|
17
|
+
return "future";
|
|
18
|
+
}
|
|
19
|
+
export function getDaysUntilDeadline(isoDate, nowMs = Date.now()) {
|
|
20
|
+
return Math.round((new Date(isoDate).getTime() - nowMs) / MS_PER_DAY);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* EU AI Act Timeline Milestones – Art. 113 Application Schedule
|
|
24
|
+
*
|
|
25
|
+
* Sources:
|
|
26
|
+
* - Regulation (EU) 2024/1689, Article 113
|
|
27
|
+
* - EU Commission AI Act Service Desk: https://ai-act-service-desk.ec.europa.eu
|
|
28
|
+
* - Digital Omnibus Proposal, November 2025 (proposed, not yet law)
|
|
29
|
+
*/
|
|
30
|
+
export const EU_AI_ACT_TIMELINE = [
|
|
31
|
+
{
|
|
32
|
+
id: "entry-into-force",
|
|
33
|
+
isoDate: "2024-08-01",
|
|
34
|
+
chapterRef: "Art. 113",
|
|
35
|
+
titleKey: "timeline_phase0_title",
|
|
36
|
+
subtitleKey: "timeline_phase0_subtitle",
|
|
37
|
+
obligations: [
|
|
38
|
+
{
|
|
39
|
+
titleKey: "timeline_obligation_regulation_published",
|
|
40
|
+
articleRef: "Art. 113",
|
|
41
|
+
audiences: ["all"],
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "phase-1-prohibited",
|
|
47
|
+
isoDate: "2025-02-02",
|
|
48
|
+
chapterRef: "Art. 113(1) – Chapter I & II",
|
|
49
|
+
titleKey: "timeline_phase1_title",
|
|
50
|
+
subtitleKey: "timeline_phase1_subtitle",
|
|
51
|
+
obligations: [
|
|
52
|
+
{
|
|
53
|
+
titleKey: "timeline_obligation_definitions",
|
|
54
|
+
articleRef: "Art. 1–4",
|
|
55
|
+
audiences: ["all"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
titleKey: "timeline_obligation_prohibited",
|
|
59
|
+
articleRef: "Art. 5",
|
|
60
|
+
audiences: ["all", "prohibited"],
|
|
61
|
+
maxPenalty: "€35M / 7%",
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
titleKey: "timeline_obligation_ai_literacy",
|
|
65
|
+
articleRef: "Art. 4",
|
|
66
|
+
audiences: ["all"],
|
|
67
|
+
},
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: "phase-2-gpai",
|
|
72
|
+
isoDate: "2025-08-02",
|
|
73
|
+
chapterRef: "Art. 113(2) – Chapter V, VII, XII",
|
|
74
|
+
titleKey: "timeline_phase2_title",
|
|
75
|
+
subtitleKey: "timeline_phase2_subtitle",
|
|
76
|
+
obligations: [
|
|
77
|
+
{
|
|
78
|
+
titleKey: "timeline_obligation_gpai_documentation",
|
|
79
|
+
articleRef: "Art. 53",
|
|
80
|
+
audiences: ["gpai"],
|
|
81
|
+
maxPenalty: "€15M / 3%",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
titleKey: "timeline_obligation_gpai_copyright",
|
|
85
|
+
articleRef: "Art. 53(1)(c)",
|
|
86
|
+
audiences: ["gpai"],
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
titleKey: "timeline_obligation_gpai_systemic_risk",
|
|
90
|
+
articleRef: "Art. 55",
|
|
91
|
+
audiences: ["gpai"],
|
|
92
|
+
maxPenalty: "€15M / 3%",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
titleKey: "timeline_obligation_notified_bodies",
|
|
96
|
+
articleRef: "Art. 28–39",
|
|
97
|
+
audiences: ["high-annex-iii", "high-annex-i"],
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
titleKey: "timeline_obligation_governance",
|
|
101
|
+
articleRef: "Art. 64–70",
|
|
102
|
+
audiences: ["all"],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
titleKey: "timeline_obligation_penalties_framework",
|
|
106
|
+
articleRef: "Art. 99–100",
|
|
107
|
+
audiences: ["all"],
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
id: "phase-3-high-risk-annex-iii",
|
|
113
|
+
isoDate: "2026-08-02",
|
|
114
|
+
chapterRef: "Art. 113(3) – Full Application",
|
|
115
|
+
titleKey: "timeline_phase3_title",
|
|
116
|
+
subtitleKey: "timeline_phase3_subtitle",
|
|
117
|
+
obligations: [
|
|
118
|
+
{
|
|
119
|
+
titleKey: "timeline_obligation_high_risk_requirements",
|
|
120
|
+
articleRef: "Art. 8–25",
|
|
121
|
+
audiences: ["high-annex-iii"],
|
|
122
|
+
maxPenalty: "€15M / 3%",
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
titleKey: "timeline_obligation_risk_management",
|
|
126
|
+
articleRef: "Art. 9",
|
|
127
|
+
audiences: ["high-annex-iii"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
titleKey: "timeline_obligation_data_governance",
|
|
131
|
+
articleRef: "Art. 10",
|
|
132
|
+
audiences: ["high-annex-iii"],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
titleKey: "timeline_obligation_transparency_deployers",
|
|
136
|
+
articleRef: "Art. 13",
|
|
137
|
+
audiences: ["high-annex-iii"],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
titleKey: "timeline_obligation_human_oversight",
|
|
141
|
+
articleRef: "Art. 14",
|
|
142
|
+
audiences: ["high-annex-iii"],
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
titleKey: "timeline_obligation_conformity_assessment",
|
|
146
|
+
articleRef: "Art. 43",
|
|
147
|
+
audiences: ["high-annex-iii"],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
titleKey: "timeline_obligation_ce_marking",
|
|
151
|
+
articleRef: "Art. 48",
|
|
152
|
+
audiences: ["high-annex-iii"],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
titleKey: "timeline_obligation_eu_database",
|
|
156
|
+
articleRef: "Art. 49",
|
|
157
|
+
audiences: ["high-annex-iii"],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
titleKey: "timeline_obligation_limited_risk_transparency",
|
|
161
|
+
articleRef: "Art. 50",
|
|
162
|
+
audiences: ["limited"],
|
|
163
|
+
maxPenalty: "€15M / 3%",
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
titleKey: "timeline_obligation_post_market",
|
|
167
|
+
articleRef: "Art. 72–73",
|
|
168
|
+
audiences: ["high-annex-iii"],
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: "phase-4-high-risk-annex-i",
|
|
174
|
+
isoDate: "2027-08-02",
|
|
175
|
+
chapterRef: "Art. 113(4) – Art. 6(1) + Annex I",
|
|
176
|
+
titleKey: "timeline_phase4_title",
|
|
177
|
+
subtitleKey: "timeline_phase4_subtitle",
|
|
178
|
+
obligations: [
|
|
179
|
+
{
|
|
180
|
+
titleKey: "timeline_obligation_annex_i_products",
|
|
181
|
+
articleRef: "Art. 6(1) + Annex I",
|
|
182
|
+
audiences: ["high-annex-i"],
|
|
183
|
+
maxPenalty: "€15M / 3%",
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
titleKey: "timeline_obligation_gpai_grace_period_ends",
|
|
187
|
+
articleRef: "Art. 113(5)",
|
|
188
|
+
audiences: ["gpai"],
|
|
189
|
+
},
|
|
190
|
+
],
|
|
191
|
+
},
|
|
192
|
+
];
|
|
193
|
+
/**
|
|
194
|
+
* Digital Omnibus proposed changes (November 2025).
|
|
195
|
+
* NOT YET LAW – under negotiation by EP and Council as of early 2026.
|
|
196
|
+
*/
|
|
197
|
+
export const DIGITAL_OMNIBUS_PROPOSALS = [
|
|
198
|
+
{
|
|
199
|
+
id: "omnibus-high-risk-annex-iii",
|
|
200
|
+
isoDate: "2027-12-02",
|
|
201
|
+
chapterRef: "Digital Omnibus (proposed)",
|
|
202
|
+
titleKey: "timeline_omnibus_phase3_title",
|
|
203
|
+
subtitleKey: "timeline_omnibus_phase3_subtitle",
|
|
204
|
+
proposed: true,
|
|
205
|
+
obligations: [
|
|
206
|
+
{
|
|
207
|
+
titleKey: "timeline_omnibus_high_risk_delayed",
|
|
208
|
+
articleRef: "Annex III (proposed)",
|
|
209
|
+
audiences: ["high-annex-iii"],
|
|
210
|
+
proposed: true,
|
|
211
|
+
},
|
|
212
|
+
],
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
id: "omnibus-high-risk-annex-i",
|
|
216
|
+
isoDate: "2028-08-02",
|
|
217
|
+
chapterRef: "Digital Omnibus (proposed)",
|
|
218
|
+
titleKey: "timeline_omnibus_phase4_title",
|
|
219
|
+
subtitleKey: "timeline_omnibus_phase4_subtitle",
|
|
220
|
+
proposed: true,
|
|
221
|
+
obligations: [
|
|
222
|
+
{
|
|
223
|
+
titleKey: "timeline_omnibus_annex_i_delayed",
|
|
224
|
+
articleRef: "Annex I (proposed)",
|
|
225
|
+
audiences: ["high-annex-i"],
|
|
226
|
+
proposed: true,
|
|
227
|
+
},
|
|
228
|
+
],
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
export function getAudiencesForRiskLevel(level) {
|
|
232
|
+
switch (level) {
|
|
233
|
+
case "unacceptable":
|
|
234
|
+
return ["all", "prohibited"];
|
|
235
|
+
case "high":
|
|
236
|
+
return ["all", "high-annex-iii", "high-annex-i"];
|
|
237
|
+
case "limited":
|
|
238
|
+
return ["all", "limited"];
|
|
239
|
+
case "minimal":
|
|
240
|
+
return ["all", "minimal"];
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export function getNextDeadline() {
|
|
244
|
+
const today = new Date().toISOString().slice(0, 10);
|
|
245
|
+
const upcoming = EU_AI_ACT_TIMELINE.filter((p) => p.isoDate > today).sort((a, b) => a.isoDate.localeCompare(b.isoDate));
|
|
246
|
+
return upcoming[0] ?? null;
|
|
247
|
+
}
|
|
248
|
+
export function getTimelineForRiskLevel(riskLevel) {
|
|
249
|
+
const audiences = getAudiencesForRiskLevel(riskLevel);
|
|
250
|
+
return EU_AI_ACT_TIMELINE.filter((phase) => phase.obligations.some((o) => o.audiences.some((a) => audiences.includes(a)))).map((phase) => ({
|
|
251
|
+
...phase,
|
|
252
|
+
status: getDeadlineStatus(phase.isoDate),
|
|
253
|
+
}));
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Filter timeline phases by explicit audience list.
|
|
257
|
+
* Use this when the caller has audiences that don't map to a RiskLevel
|
|
258
|
+
* (e.g., GPAI providers need ["all", "gpai"]).
|
|
259
|
+
*/
|
|
260
|
+
export function getTimelineForAudiences(audiences) {
|
|
261
|
+
return EU_AI_ACT_TIMELINE.filter((phase) => phase.obligations.some((o) => o.audiences.some((a) => audiences.includes(a)))).map((phase) => ({
|
|
262
|
+
...phase,
|
|
263
|
+
status: getDeadlineStatus(phase.isoDate),
|
|
264
|
+
}));
|
|
265
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Compliance Gap Analysis Generator
|
|
3
|
+
* Produces prioritized action plans from EU AI Act assessment results.
|
|
4
|
+
*
|
|
5
|
+
* Supports:
|
|
6
|
+
* - Annex III high-risk assessment → mandatory Art. 9–15 + Art. 43 + Art. 71 obligations
|
|
7
|
+
* - GPAI compliance assessment → gaps directly from GPAIComplianceResult flags
|
|
8
|
+
*
|
|
9
|
+
* IMPORTANT: This module provides technical orientation, not legal advice.
|
|
10
|
+
*/
|
|
11
|
+
import type { RiskAssessment } from "../types";
|
|
12
|
+
import type { GPAIComplianceResult } from "./gpai-classifier";
|
|
13
|
+
/** Priority level for a compliance gap action */
|
|
14
|
+
export type GapPriority = "critical" | "high" | "medium";
|
|
15
|
+
/** A single compliance gap with actionable remediation steps */
|
|
16
|
+
export interface GapAction {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
description: string;
|
|
20
|
+
articleRef: string;
|
|
21
|
+
priority: GapPriority;
|
|
22
|
+
status: "missing" | "partial";
|
|
23
|
+
steps: string[];
|
|
24
|
+
penaltyRef?: string;
|
|
25
|
+
}
|
|
26
|
+
/** Aggregated gap analysis result */
|
|
27
|
+
export interface GapAnalysisResult {
|
|
28
|
+
totalGaps: number;
|
|
29
|
+
criticalCount: number;
|
|
30
|
+
highCount: number;
|
|
31
|
+
mediumCount: number;
|
|
32
|
+
actions: GapAction[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Generate a gap analysis action plan from an Annex III risk assessment.
|
|
36
|
+
*
|
|
37
|
+
* - unacceptable → Art. 5 prohibition action (critical)
|
|
38
|
+
* - high → all mandatory Art. 9–15 + Art. 43 + Art. 71 + Art. 72 obligations
|
|
39
|
+
* - limited → Art. 50 transparency obligations
|
|
40
|
+
* - minimal → no gaps
|
|
41
|
+
*/
|
|
42
|
+
export declare function generateAnnexIIIGapAnalysis(assessment: RiskAssessment): GapAnalysisResult;
|
|
43
|
+
/**
|
|
44
|
+
* Generate a gap analysis action plan from a GPAI compliance result.
|
|
45
|
+
* Only generates actions for obligations flagged as missing or partial.
|
|
46
|
+
*/
|
|
47
|
+
export declare function generateGPAIGapAnalysis(result: GPAIComplianceResult): GapAnalysisResult;
|
|
48
|
+
//# sourceMappingURL=gap-analysis.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gap-analysis.d.ts","sourceRoot":"","sources":["../../src/legal-checks/gap-analysis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,oBAAoB,EAAsB,MAAM,mBAAmB,CAAC;AAElF,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEzD,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,WAAW,CAAC;IACtB,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,SAAS,EAAE,CAAC;CACtB;AA8TD;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,cAAc,GAAG,iBAAiB,CAuEzF;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,GAAG,iBAAiB,CAcvF"}
|