feat(iace): Phase 1 — Haftungs-Fixes, Massnahmen-Verkabelung, Explainability Engine

Phase 1A — Haftungs-kritische Fixes:
- SIL/PL-Badges als "Vorab-Einschaetzung" mit Tooltip gekennzeichnet
- Coverage-Disclaimer in CE-Akte, Projekt-Uebersicht und Print-Export
- Norm-Referenzen: 42 Kapitelverweise durch Themen-Deskriptoren ersetzt

Phase 1B — Massnahmen-Verkabelung:
- 16 neue Massnahmen (M201-M216) fuer bisher unabgedeckte Kategorien
  (communication_failure, hmi_error, firmware_corruption, maintenance,
  sensor_fault, mode_confusion)
- Kategorie-Fallback im Initialize-Endpoint: ordnet Massnahmen aus der
  Bibliothek automatisch per HazardCategory zu (max 8 pro Kategorie)
- Total: 225 → 241 Massnahmen, 0 Kategorien ohne Massnahmen

Phase 1C — Explainability Engine:
- MatchReason Struct in PatternMatch (type, tag, met)
- Pattern Engine schreibt fuer jeden Match strukturierte Begruendungen
- Frontend zeigt "Erkannt weil: Komponente X, Energie Y, Kein Ausschluss Z"

Weitere Aenderungen:
- BAuA/OSHA Regulatory Hints: 3 Enrich-Endpoints (per Hazard, per Measure, Batch)
- Dokumente-Tab in IACE-Bibliothek (36.708 Chunks aus Qdrant)
- Varianten-UX: Basis-Projekt-Summary auf Varianten-Seite
- Projekt-Initialisierung: POST /initialize kettet Parse→Komponenten→Patterns→Hazards→Massnahmen→Normen
- 18 pre-existing TS-Fehler gefixt, Route-Konflikt behoben
- Component-Library + Measures-Library Tests aktualisiert

Tests: Go alle bestanden, TS 0 Fehler, Playwright 141+ bestanden

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-09 21:32:23 +02:00
parent 6387b6950a
commit 2e29b611c9
39 changed files with 1859 additions and 180 deletions
@@ -113,16 +113,25 @@ describe('getPreviousStep', () => {
})
describe('getCompletionPercentage', () => {
const createMockState = (completedSteps: string[]): SDKState => ({
const createMockState = (completedSteps: string[]) => ({
version: '1.0.0',
projectVersion: 1,
lastModified: new Date(),
tenantId: 'test',
userId: 'test',
subscription: 'PROFESSIONAL',
projectId: 'test-project',
projectInfo: null,
customerType: null,
companyProfile: null,
complianceScope: null,
sourcePolicy: null,
currentPhase: 1,
currentStep: 'use-case-assessment',
completedSteps,
checkpoints: {},
importedDocuments: [],
gapAnalysis: null,
useCases: [],
activeUseCase: null,
screening: null,
@@ -143,9 +152,12 @@ describe('getCompletionPercentage', () => {
consents: [],
dsrConfig: null,
escalationWorkflows: [],
iaceProjects: [],
ragCorpusStatus: null,
sbom: null,
securityIssues: [],
securityBacklog: [],
customCatalogs: {},
commandBarHistory: [],
recentSearches: [],
preferences: {
@@ -157,7 +169,7 @@ describe('getCompletionPercentage', () => {
autoValidate: true,
allowParallelWork: true,
},
})
}) as SDKState
it('should return 0 for no completed steps', () => {
const state = createMockState([])
@@ -182,16 +194,25 @@ describe('getCompletionPercentage', () => {
})
describe('getPhaseCompletionPercentage', () => {
const createMockState = (completedSteps: string[]): SDKState => ({
const createMockState = (completedSteps: string[]) => ({
version: '1.0.0',
projectVersion: 1,
lastModified: new Date(),
tenantId: 'test',
userId: 'test',
subscription: 'PROFESSIONAL',
projectId: 'test-project',
projectInfo: null,
customerType: null,
companyProfile: null,
complianceScope: null,
sourcePolicy: null,
currentPhase: 1,
currentStep: 'use-case-assessment',
completedSteps,
checkpoints: {},
importedDocuments: [],
gapAnalysis: null,
useCases: [],
activeUseCase: null,
screening: null,
@@ -212,9 +233,12 @@ describe('getPhaseCompletionPercentage', () => {
consents: [],
dsrConfig: null,
escalationWorkflows: [],
iaceProjects: [],
ragCorpusStatus: null,
sbom: null,
securityIssues: [],
securityBacklog: [],
customCatalogs: {},
commandBarHistory: [],
recentSearches: [],
preferences: {
@@ -226,7 +250,7 @@ describe('getPhaseCompletionPercentage', () => {
autoValidate: true,
allowParallelWork: true,
},
})
}) as SDKState
it('should return 0 for Phase 1 with no completed steps', () => {
const state = createMockState([])