Fix Scope evaluation crash: align property names between engine, types, and components
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Failing after 35s
CI / test-python-backend-compliance (push) Successful in 39s
CI / test-python-document-crawler (push) Successful in 27s
CI / test-python-dsms-gateway (push) Successful in 25s
Some checks failed
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-ai-compliance (push) Failing after 35s
CI / test-python-backend-compliance (push) Successful in 39s
CI / test-python-document-crawler (push) Successful in 27s
CI / test-python-dsms-gateway (push) Successful in 25s
The engine used short property names (risk, complexity, assurance, composite) while the ComplianceScores interface defined (risk_score, complexity_score, assurance_need, composite_score). Components used yet another convention (riskScore, level, hardTriggers). The main crash was DEPTH_LEVEL_COLORS[decision.level] where decision.level was undefined (correct property: decision.determinedLevel). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1051,10 +1051,10 @@ export class ComplianceScopeEngine {
|
||||
const composite = riskScore * 0.4 + complexityScore * 0.3 + assuranceScore * 0.3
|
||||
|
||||
return {
|
||||
risk: Math.round(riskScore * 10) / 10,
|
||||
complexity: Math.round(complexityScore * 10) / 10,
|
||||
assurance: Math.round(assuranceScore * 10) / 10,
|
||||
composite: Math.round(composite * 10) / 10,
|
||||
risk_score: Math.round(riskScore * 10) / 10,
|
||||
complexity_score: Math.round(complexityScore * 10) / 10,
|
||||
assurance_need: Math.round(assuranceScore * 10) / 10,
|
||||
composite_score: Math.round(composite * 10) / 10,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1276,9 +1276,9 @@ export class ComplianceScopeEngine {
|
||||
): ComplianceDepthLevel {
|
||||
// Score-basiertes Level
|
||||
let levelFromScore: ComplianceDepthLevel
|
||||
if (scores.composite <= 25) levelFromScore = 'L1'
|
||||
else if (scores.composite <= 50) levelFromScore = 'L2'
|
||||
else if (scores.composite <= 75) levelFromScore = 'L3'
|
||||
if (scores.composite_score <= 25) levelFromScore = 'L1'
|
||||
else if (scores.composite_score <= 50) levelFromScore = 'L2'
|
||||
else if (scores.composite_score <= 75) levelFromScore = 'L3'
|
||||
else levelFromScore = 'L4'
|
||||
|
||||
// Höchstes Level aus Triggers
|
||||
@@ -1650,12 +1650,12 @@ export class ComplianceScopeEngine {
|
||||
step: 'score_calculation',
|
||||
description: 'Risikobasierte Score-Berechnung aus Profiling-Antworten',
|
||||
factors: [
|
||||
`Risiko-Score: ${scores.risk}/10`,
|
||||
`Komplexitäts-Score: ${scores.complexity}/10`,
|
||||
`Assurance-Score: ${scores.assurance}/10`,
|
||||
`Composite Score: ${scores.composite}/10`,
|
||||
`Risiko-Score: ${scores.risk_score}/10`,
|
||||
`Komplexitäts-Score: ${scores.complexity_score}/10`,
|
||||
`Assurance-Score: ${scores.assurance_need}/10`,
|
||||
`Composite Score: ${scores.composite_score}/10`,
|
||||
],
|
||||
impact: `Score-basiertes Level: ${this.getLevelFromScore(scores.composite)}`,
|
||||
impact: `Score-basiertes Level: ${this.getLevelFromScore(scores.composite_score)}`,
|
||||
})
|
||||
|
||||
// 2. Hard Trigger Evaluation
|
||||
@@ -1675,7 +1675,7 @@ export class ComplianceScopeEngine {
|
||||
step: 'level_determination',
|
||||
description: 'Finales Compliance-Level durch Maximum aus Score und Triggers',
|
||||
factors: [
|
||||
`Score-Level: ${this.getLevelFromScore(scores.composite)}`,
|
||||
`Score-Level: ${this.getLevelFromScore(scores.composite_score)}`,
|
||||
`Trigger-Level: ${this.getMaxTriggerLevel(triggers)}`,
|
||||
],
|
||||
impact: `Finales Level: ${level}`,
|
||||
|
||||
Reference in New Issue
Block a user