@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
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @euconform/core
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- caae33d: ECEF Stage 2: Add bundle.v1 manifest with SHA-256 integrity hashes and optional ZIP transport. Add verify command to CLI for manifest, directory, and ZIP validation. First public release of @euconform/cli with scan, verify, and --zip support.
|
|
8
|
+
|
|
9
|
+
## 1.2.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 50566c7: Add GPAI compliance module (Art. 53-55) with dedicated quiz flow, classifier, and results checklist for Foundation Model providers. Add compliance gap analysis with prioritized action plans for both Annex III and GPAI paths. Fix open-source unsure flag,
|
|
14
|
+
|
|
3
15
|
## 1.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ScanBundle } from "./types";
|
|
2
|
+
interface ArtifactInput {
|
|
3
|
+
content: string;
|
|
4
|
+
fileName: string;
|
|
5
|
+
}
|
|
6
|
+
interface BuildBundleOptions {
|
|
7
|
+
report: ArtifactInput;
|
|
8
|
+
aibom?: ArtifactInput;
|
|
9
|
+
ci?: ArtifactInput;
|
|
10
|
+
summary?: ArtifactInput;
|
|
11
|
+
tool: {
|
|
12
|
+
name: string;
|
|
13
|
+
version: string;
|
|
14
|
+
};
|
|
15
|
+
target: {
|
|
16
|
+
name: string;
|
|
17
|
+
rootPath: string;
|
|
18
|
+
};
|
|
19
|
+
generatedAt: string;
|
|
20
|
+
}
|
|
21
|
+
export declare function buildBundleManifest(opts: BuildBundleOptions): ScanBundle;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/evidence/bundle.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAyC,UAAU,EAAE,MAAM,SAAS,CAAC;AAEjF,UAAU,aAAa;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,UAAU,kBAAkB;IAC1B,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,EAAE,CAAC,EAAE,aAAa,CAAC;IACnB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,MAAM,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C,WAAW,EAAE,MAAM,CAAC;CACrB;AAkCD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,kBAAkB,GAAG,UAAU,CAcxE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { sha256Hex } from "./hash";
|
|
2
|
+
function extractSchemaVersion(content) {
|
|
3
|
+
try {
|
|
4
|
+
const parsed = JSON.parse(content);
|
|
5
|
+
return typeof parsed.schemaVersion === "string" ? parsed.schemaVersion : undefined;
|
|
6
|
+
}
|
|
7
|
+
catch {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function makeArtifactRef(role, input, required) {
|
|
12
|
+
const isJson = input.fileName.endsWith(".json");
|
|
13
|
+
const ref = {
|
|
14
|
+
role,
|
|
15
|
+
fileName: input.fileName,
|
|
16
|
+
sha256: sha256Hex(input.content),
|
|
17
|
+
required,
|
|
18
|
+
};
|
|
19
|
+
if (isJson) {
|
|
20
|
+
const sv = extractSchemaVersion(input.content);
|
|
21
|
+
if (sv)
|
|
22
|
+
ref.schemaVersion = sv;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
ref.mimeType = "text/markdown";
|
|
26
|
+
}
|
|
27
|
+
return ref;
|
|
28
|
+
}
|
|
29
|
+
export function buildBundleManifest(opts) {
|
|
30
|
+
const artifacts = [makeArtifactRef("report", opts.report, true)];
|
|
31
|
+
if (opts.aibom)
|
|
32
|
+
artifacts.push(makeArtifactRef("aibom", opts.aibom, false));
|
|
33
|
+
if (opts.ci)
|
|
34
|
+
artifacts.push(makeArtifactRef("ci", opts.ci, false));
|
|
35
|
+
if (opts.summary)
|
|
36
|
+
artifacts.push(makeArtifactRef("summary", opts.summary, false));
|
|
37
|
+
return {
|
|
38
|
+
schemaVersion: "euconform.bundle.v1",
|
|
39
|
+
generatedAt: opts.generatedAt,
|
|
40
|
+
tool: opts.tool,
|
|
41
|
+
target: opts.target,
|
|
42
|
+
artifacts,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { DetectedSignal, FileProvenance, SignalCategory, SignalEvidence } from "./types";
|
|
2
|
+
export declare const IMPLEMENTATION_PROVENANCE: Set<FileProvenance>;
|
|
3
|
+
export declare function isUserFacingPath(relativePath: string): boolean;
|
|
4
|
+
export declare function isImplementationEvidence(category: SignalCategory, evidence: SignalEvidence): boolean;
|
|
5
|
+
export declare function isSupportingEvidence(category: SignalCategory, evidence: SignalEvidence): boolean;
|
|
6
|
+
export interface EvaluatedSignalSet {
|
|
7
|
+
implementationSignals: DetectedSignal[];
|
|
8
|
+
supportingSignals: DetectedSignal[];
|
|
9
|
+
}
|
|
10
|
+
export declare function evaluateSignalsForCategories(signals: DetectedSignal[], categories: SignalCategory[]): EvaluatedSignalSet;
|
|
11
|
+
export declare function hasImplementationSignals(signals: DetectedSignal[], categories: SignalCategory[]): boolean;
|
|
12
|
+
//# sourceMappingURL=compliance-evaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compliance-evaluation.d.ts","sourceRoot":"","sources":["../../src/evidence/compliance-evaluation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9F,eAAO,MAAM,yBAAyB,qBAAiD,CAAC;AAkCxF,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAS9D;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAUT;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,GAAG,OAAO,CAQhG;AAWD,MAAM,WAAW,kBAAkB;IACjC,qBAAqB,EAAE,cAAc,EAAE,CAAC;IACxC,iBAAiB,EAAE,cAAc,EAAE,CAAC;CACrC;AAED,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,cAAc,EAAE,EACzB,UAAU,EAAE,cAAc,EAAE,GAC3B,kBAAkB,CAiBpB;AAED,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,cAAc,EAAE,EACzB,UAAU,EAAE,cAAc,EAAE,GAC3B,OAAO,CAET"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export const IMPLEMENTATION_PROVENANCE = new Set(["runtime", "config"]);
|
|
2
|
+
const SUPPORTING_PROVENANCE = new Set(["root-docs", "docs"]);
|
|
3
|
+
const USER_FACING_SEGMENTS = new Set([
|
|
4
|
+
"app",
|
|
5
|
+
"pages",
|
|
6
|
+
"routes",
|
|
7
|
+
"route",
|
|
8
|
+
"components",
|
|
9
|
+
"ui",
|
|
10
|
+
"views",
|
|
11
|
+
"view",
|
|
12
|
+
"screens",
|
|
13
|
+
"screen",
|
|
14
|
+
"templates",
|
|
15
|
+
"template",
|
|
16
|
+
"public",
|
|
17
|
+
"content",
|
|
18
|
+
"locales",
|
|
19
|
+
"messages",
|
|
20
|
+
"copy",
|
|
21
|
+
"emails",
|
|
22
|
+
]);
|
|
23
|
+
const USER_FACING_BASENAME_PATTERN = /(?:page|layout|route|template|loading|error|view|screen|dialog|modal|form|widget|banner|notice)\.[^.]+$/i;
|
|
24
|
+
function normalizedProvenance(provenance) {
|
|
25
|
+
return provenance ?? "runtime";
|
|
26
|
+
}
|
|
27
|
+
function isInternalAnalysisPath(relativePath) {
|
|
28
|
+
const normalized = relativePath.replace(/\\/g, "/").toLowerCase();
|
|
29
|
+
return normalized.includes("/scanner/") || normalized.includes("/detectors/");
|
|
30
|
+
}
|
|
31
|
+
export function isUserFacingPath(relativePath) {
|
|
32
|
+
const normalized = relativePath.replace(/\\/g, "/").toLowerCase();
|
|
33
|
+
const segments = normalized.split("/").filter(Boolean);
|
|
34
|
+
const basename = segments[segments.length - 1] ?? "";
|
|
35
|
+
return (segments.some((segment) => USER_FACING_SEGMENTS.has(segment)) ||
|
|
36
|
+
USER_FACING_BASENAME_PATTERN.test(basename));
|
|
37
|
+
}
|
|
38
|
+
export function isImplementationEvidence(category, evidence) {
|
|
39
|
+
const provenance = normalizedProvenance(evidence.provenance);
|
|
40
|
+
if (!IMPLEMENTATION_PROVENANCE.has(provenance))
|
|
41
|
+
return false;
|
|
42
|
+
if (isInternalAnalysisPath(evidence.file))
|
|
43
|
+
return false;
|
|
44
|
+
if (category === "compliance-disclosure") {
|
|
45
|
+
return isUserFacingPath(evidence.file);
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
export function isSupportingEvidence(category, evidence) {
|
|
50
|
+
const provenance = normalizedProvenance(evidence.provenance);
|
|
51
|
+
if (!SUPPORTING_PROVENANCE.has(provenance))
|
|
52
|
+
return false;
|
|
53
|
+
if (category === "compliance-disclosure")
|
|
54
|
+
return true;
|
|
55
|
+
if (category.startsWith("compliance-"))
|
|
56
|
+
return true;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
function withFilteredEvidence(signal, matcher) {
|
|
60
|
+
const evidence = signal.evidence.filter(matcher);
|
|
61
|
+
if (evidence.length === 0)
|
|
62
|
+
return null;
|
|
63
|
+
return { ...signal, evidence };
|
|
64
|
+
}
|
|
65
|
+
export function evaluateSignalsForCategories(signals, categories) {
|
|
66
|
+
const relevant = signals.filter((signal) => categories.includes(signal.category));
|
|
67
|
+
return {
|
|
68
|
+
implementationSignals: relevant
|
|
69
|
+
.map((signal) => withFilteredEvidence(signal, (evidence) => isImplementationEvidence(signal.category, evidence)))
|
|
70
|
+
.filter((signal) => signal !== null),
|
|
71
|
+
supportingSignals: relevant
|
|
72
|
+
.map((signal) => withFilteredEvidence(signal, (evidence) => isSupportingEvidence(signal.category, evidence)))
|
|
73
|
+
.filter((signal) => signal !== null),
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
export function hasImplementationSignals(signals, categories) {
|
|
77
|
+
return evaluateSignalsForCategories(signals, categories).implementationSignals.length > 0;
|
|
78
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../src/evidence/hash.ts"],"names":[],"mappings":"AAEA,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @euconform/core/evidence — Evidence model and output generation
|
|
3
|
+
*
|
|
4
|
+
* This module defines the evidence types produced by the scanner
|
|
5
|
+
* and transforms raw scan results into structured output artifacts.
|
|
6
|
+
*/
|
|
7
|
+
export type { AiBillOfMaterials, AppType, AssessmentHint, BomComponent, BomComponentKind, BundleArtifactRef, BundleArtifactRole, CiReport, ComplianceSignalGroup, ConfidenceLevel, DetectedSignal, DetectorContext, FailOnLevel, FileProvenance, GapCounts, OpenQuestion, RepoProfile, ScanBundle, ScanFile, ScanGap, ScanMeta, ScanOptions, ScanOutput, ScanReport, ScanResult, ScanScope, SignalCategory, SignalDetector, SignalEvidence, } from "./types";
|
|
8
|
+
export { generateScanOutput } from "./output";
|
|
9
|
+
export { generateSummaryMarkdown } from "./markdown";
|
|
10
|
+
export { buildBundleManifest } from "./bundle";
|
|
11
|
+
export { sha256Hex } from "./hash";
|
|
12
|
+
export { getSchemaMajorVersion, validateAiBillOfMaterials, validateCiReport, validateEcefJsonDocument, validateScanBundle, validateScanReport, } from "./validate";
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evidence/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,iBAAiB,EACjB,OAAO,EACP,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,QAAQ,EACR,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,eAAe,EACf,WAAW,EACX,cAAc,EACd,SAAS,EACT,YAAY,EACZ,WAAW,EACX,UAAU,EACV,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,WAAW,EACX,UAAU,EACV,UAAU,EACV,UAAU,EACV,SAAS,EACT,cAAc,EACd,cAAc,EACd,cAAc,GACf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACnC,OAAO,EACL,qBAAqB,EACrB,yBAAyB,EACzB,gBAAgB,EAChB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @euconform/core/evidence — Evidence model and output generation
|
|
3
|
+
*
|
|
4
|
+
* This module defines the evidence types produced by the scanner
|
|
5
|
+
* and transforms raw scan results into structured output artifacts.
|
|
6
|
+
*/
|
|
7
|
+
export { generateScanOutput } from "./output";
|
|
8
|
+
export { generateSummaryMarkdown } from "./markdown";
|
|
9
|
+
export { buildBundleManifest } from "./bundle";
|
|
10
|
+
export { sha256Hex } from "./hash";
|
|
11
|
+
export { getSchemaMajorVersion, validateAiBillOfMaterials, validateCiReport, validateEcefJsonDocument, validateScanBundle, validateScanReport, } from "./validate";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EuConform Evidence Engine — Markdown Summary Generation
|
|
3
|
+
*
|
|
4
|
+
* Generates a human-readable markdown summary from ScanReport and AiBillOfMaterials.
|
|
5
|
+
* Pure function — no side effects, no filesystem operations.
|
|
6
|
+
*/
|
|
7
|
+
import type { AiBillOfMaterials, ScanReport, ScanScope } from "./types";
|
|
8
|
+
export declare function generateSummaryMarkdown(report: ScanReport, aibom: AiBillOfMaterials, scanScope: ScanScope): string;
|
|
9
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/evidence/markdown.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,iBAAiB,EAGjB,UAAU,EACV,SAAS,EACV,MAAM,SAAS,CAAC;AAmMjB,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,UAAU,EAClB,KAAK,EAAE,iBAAiB,EACxB,SAAS,EAAE,SAAS,GACnB,MAAM,CAaR"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EuConform Evidence Engine — Markdown Summary Generation
|
|
3
|
+
*
|
|
4
|
+
* Generates a human-readable markdown summary from ScanReport and AiBillOfMaterials.
|
|
5
|
+
* Pure function — no side effects, no filesystem operations.
|
|
6
|
+
*/
|
|
7
|
+
const COMPLIANCE_LABELS = {
|
|
8
|
+
disclosure: "AI Disclosure",
|
|
9
|
+
biasTesting: "Bias Testing",
|
|
10
|
+
reportingExports: "Reporting & Exports",
|
|
11
|
+
loggingMonitoring: "Logging & Monitoring",
|
|
12
|
+
humanOversight: "Human Oversight",
|
|
13
|
+
dataGovernance: "Data Governance",
|
|
14
|
+
incidentReporting: "Incident Reporting",
|
|
15
|
+
};
|
|
16
|
+
const STATUS_LABELS = {
|
|
17
|
+
present: "Present",
|
|
18
|
+
partial: "Partial",
|
|
19
|
+
absent: "Absent",
|
|
20
|
+
unknown: "Unknown",
|
|
21
|
+
};
|
|
22
|
+
function bomKindLabel(kind) {
|
|
23
|
+
const labels = {
|
|
24
|
+
framework: "Framework",
|
|
25
|
+
runtime: "Runtime",
|
|
26
|
+
"inference-provider": "Inference Provider",
|
|
27
|
+
"ai-framework": "AI Framework",
|
|
28
|
+
model: "Model",
|
|
29
|
+
"vector-store": "Vector Store",
|
|
30
|
+
embedding: "Embedding",
|
|
31
|
+
dataset: "Dataset",
|
|
32
|
+
tool: "Tool",
|
|
33
|
+
};
|
|
34
|
+
return labels[kind];
|
|
35
|
+
}
|
|
36
|
+
function formatDate(iso) {
|
|
37
|
+
try {
|
|
38
|
+
const d = new Date(iso);
|
|
39
|
+
return d.toISOString().split("T")[0] ?? iso;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return iso;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
// ---------------------------------------------------------------------------
|
|
46
|
+
// Section builders
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
function buildHeader(report, scanScope) {
|
|
49
|
+
const date = formatDate(report.generatedAt);
|
|
50
|
+
return [
|
|
51
|
+
"# EuConform Scan Report",
|
|
52
|
+
"",
|
|
53
|
+
"> **Disclaimer:** This is technical guidance only. It does not constitute legal advice.",
|
|
54
|
+
`> Generated by EuConform v${report.tool.version} on ${date}.`,
|
|
55
|
+
`> Scan scope: \`${scanScope}\`.`,
|
|
56
|
+
].join("\n");
|
|
57
|
+
}
|
|
58
|
+
function buildProjectOverview(report) {
|
|
59
|
+
const lines = [
|
|
60
|
+
"## Project Overview",
|
|
61
|
+
"",
|
|
62
|
+
`- **Name:** ${report.target.name}`,
|
|
63
|
+
`- **Type:** ${report.target.repoType}`,
|
|
64
|
+
];
|
|
65
|
+
if (report.target.detectedStack.length > 0) {
|
|
66
|
+
lines.push(`- **Stack:** ${report.target.detectedStack.join(", ")}`);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
lines.push("- **Stack:** Not detected");
|
|
70
|
+
}
|
|
71
|
+
return lines.join("\n");
|
|
72
|
+
}
|
|
73
|
+
function buildAiComponents(aibom) {
|
|
74
|
+
const lines = ["## AI Components Detected", ""];
|
|
75
|
+
if (aibom.components.length === 0) {
|
|
76
|
+
lines.push("No AI components detected.");
|
|
77
|
+
return lines.join("\n");
|
|
78
|
+
}
|
|
79
|
+
lines.push("| Component | Kind | Source |");
|
|
80
|
+
lines.push("|-----------|------|--------|");
|
|
81
|
+
for (const comp of aibom.components) {
|
|
82
|
+
lines.push(`| ${comp.name} | ${bomKindLabel(comp.kind)} | ${comp.source} |`);
|
|
83
|
+
}
|
|
84
|
+
return lines.join("\n");
|
|
85
|
+
}
|
|
86
|
+
function buildComplianceSignals(report) {
|
|
87
|
+
const lines = ["## Compliance Signals", ""];
|
|
88
|
+
lines.push("| Area | Status | Confidence |");
|
|
89
|
+
lines.push("|------|--------|------------|");
|
|
90
|
+
const areas = Object.keys(COMPLIANCE_LABELS);
|
|
91
|
+
for (const area of areas) {
|
|
92
|
+
const group = report.complianceSignals[area];
|
|
93
|
+
lines.push(`| ${COMPLIANCE_LABELS[area]} | ${STATUS_LABELS[group.status]} | ${group.confidence} |`);
|
|
94
|
+
}
|
|
95
|
+
return lines.join("\n");
|
|
96
|
+
}
|
|
97
|
+
function buildAssessmentHints(report) {
|
|
98
|
+
const { riskIndicators, gpaiIndicators, possibleModes } = report.assessmentHints;
|
|
99
|
+
const lines = ["## Assessment Hints", ""];
|
|
100
|
+
if (gpaiIndicators.length === 0 && riskIndicators.length === 0 && possibleModes.length === 0) {
|
|
101
|
+
lines.push("No assessment hints generated (no AI detected).");
|
|
102
|
+
return lines.join("\n");
|
|
103
|
+
}
|
|
104
|
+
if (possibleModes.length > 0) {
|
|
105
|
+
lines.push(`**Possible classification modes:** ${possibleModes.join(", ")}`);
|
|
106
|
+
lines.push("");
|
|
107
|
+
}
|
|
108
|
+
if (gpaiIndicators.length > 0) {
|
|
109
|
+
lines.push("### GPAI Indicators");
|
|
110
|
+
lines.push("");
|
|
111
|
+
for (const hint of gpaiIndicators) {
|
|
112
|
+
const ref = hint.articleRef ? ` (${hint.articleRef})` : "";
|
|
113
|
+
lines.push(`- ${hint.hint}${ref}`);
|
|
114
|
+
}
|
|
115
|
+
lines.push("");
|
|
116
|
+
}
|
|
117
|
+
if (riskIndicators.length > 0) {
|
|
118
|
+
lines.push("### Risk Indicators");
|
|
119
|
+
lines.push("");
|
|
120
|
+
for (const hint of riskIndicators) {
|
|
121
|
+
const ref = hint.articleRef ? ` (${hint.articleRef})` : "";
|
|
122
|
+
lines.push(`- ${hint.hint}${ref}`);
|
|
123
|
+
}
|
|
124
|
+
lines.push("");
|
|
125
|
+
}
|
|
126
|
+
return lines.join("\n");
|
|
127
|
+
}
|
|
128
|
+
function buildOpenQuestions(report) {
|
|
129
|
+
const questions = report.assessmentHints.openQuestions;
|
|
130
|
+
const lines = ["## Open Questions", ""];
|
|
131
|
+
if (questions.length === 0) {
|
|
132
|
+
lines.push("No open questions.");
|
|
133
|
+
return lines.join("\n");
|
|
134
|
+
}
|
|
135
|
+
questions.forEach((q, i) => {
|
|
136
|
+
lines.push(`${i + 1}. ${q}`);
|
|
137
|
+
});
|
|
138
|
+
return lines.join("\n");
|
|
139
|
+
}
|
|
140
|
+
function buildRecommendedActions(report) {
|
|
141
|
+
const lines = ["## Recommended Actions", ""];
|
|
142
|
+
if (report.recommendationSummary.length === 0) {
|
|
143
|
+
lines.push("No recommended actions.");
|
|
144
|
+
return lines.join("\n");
|
|
145
|
+
}
|
|
146
|
+
for (const rec of report.recommendationSummary) {
|
|
147
|
+
lines.push(`- ${rec}`);
|
|
148
|
+
}
|
|
149
|
+
return lines.join("\n");
|
|
150
|
+
}
|
|
151
|
+
function buildFooter() {
|
|
152
|
+
return ["---", "*Full details: `euconform.report.json` -- AI BOM: `euconform.aibom.json`*"].join("\n");
|
|
153
|
+
}
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// Main export
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
export function generateSummaryMarkdown(report, aibom, scanScope) {
|
|
158
|
+
const sections = [
|
|
159
|
+
buildHeader(report, scanScope),
|
|
160
|
+
buildProjectOverview(report),
|
|
161
|
+
buildAiComponents(aibom),
|
|
162
|
+
buildComplianceSignals(report),
|
|
163
|
+
buildAssessmentHints(report),
|
|
164
|
+
buildOpenQuestions(report),
|
|
165
|
+
buildRecommendedActions(report),
|
|
166
|
+
buildFooter(),
|
|
167
|
+
];
|
|
168
|
+
return `${sections.join("\n\n")}\n`;
|
|
169
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EuConform Evidence Engine — Output Generation
|
|
3
|
+
*
|
|
4
|
+
* Transforms a ScanResult into a ScanOutput containing:
|
|
5
|
+
* - ScanReport (euconform.report.v1)
|
|
6
|
+
* - AiBillOfMaterials (euconform.aibom.v1)
|
|
7
|
+
* - summaryMarkdown
|
|
8
|
+
*
|
|
9
|
+
* Pure function — no side effects, no filesystem operations.
|
|
10
|
+
*/
|
|
11
|
+
import type { ScanOutput, ScanResult } from "./types";
|
|
12
|
+
export declare function generateScanOutput(scanResult: ScanResult): ScanOutput;
|
|
13
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/evidence/output.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EASV,UAAU,EAEV,UAAU,EAGX,MAAM,SAAS,CAAC;AAkoBjB,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CA+CrE"}
|