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:
@@ -73,11 +73,11 @@ func TestProtectiveMeasures_HazardCategoryNotEmpty(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestProtectiveMeasures_Count200 verifies exactly 200 measures exist.
|
||||
func TestProtectiveMeasures_Count200(t *testing.T) {
|
||||
// TestProtectiveMeasures_Count241 verifies at least 241 measures exist (200 base + 25 mandatory + 16 Phase1B).
|
||||
func TestProtectiveMeasures_Count241(t *testing.T) {
|
||||
entries := GetProtectiveMeasureLibrary()
|
||||
if len(entries) != 200 {
|
||||
t.Fatalf("got %d protective measures, want exactly 200", len(entries))
|
||||
if len(entries) < 241 {
|
||||
t.Fatalf("got %d protective measures, want at least 241", len(entries))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,13 +126,17 @@ func TestProtectiveMeasures_DesignProtectionInfoDistribution(t *testing.T) {
|
||||
t.Logf("Distribution: design=%d, protection=%d, information=%d", design, protection, information)
|
||||
}
|
||||
|
||||
// TestProtectiveMeasures_IDSequential verifies IDs run M001-M200 without gaps.
|
||||
func TestProtectiveMeasures_IDSequential(t *testing.T) {
|
||||
// TestProtectiveMeasures_UniqueIDs verifies all measure IDs are unique.
|
||||
func TestProtectiveMeasures_UniqueIDs(t *testing.T) {
|
||||
entries := GetProtectiveMeasureLibrary()
|
||||
for i, e := range entries {
|
||||
expected := "M" + padID(i+1)
|
||||
if e.ID != expected {
|
||||
t.Errorf("entries[%d]: got ID %q, want %q", i, e.ID, expected)
|
||||
seen := make(map[string]bool)
|
||||
for _, e := range entries {
|
||||
if seen[e.ID] {
|
||||
t.Errorf("duplicate measure ID: %s", e.ID)
|
||||
}
|
||||
seen[e.ID] = true
|
||||
if e.ID == "" {
|
||||
t.Error("empty measure ID found")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user