feat(iace): 50% display threshold — weak matches shown as separate

Matches below 50% are now split:
- GT entries → "Fehlend" tab (not matched by engine)
- Engine entries → "Engine Findings" tab (additional findings)
Only matches >= 50% shown in "Zugeordnet" tab.

Coverage score now counts only real matches (>= 50%).
"Extra" tab renamed to "Engine Findings" for clarity.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-05-15 10:33:29 +02:00
parent 3469105d18
commit 3b7ab4cbd7
2 changed files with 20 additions and 11 deletions
@@ -14,14 +14,21 @@ type TabType = 'matched' | 'missing' | 'extra'
export function HazardComparisonTable({ matched, missing, extra }: Props) {
const [tab, setTab] = useState<TabType>('matched')
// Compute quality levels for matched pairs
const greenCount = matched.filter(p => p.match_score >= 0.7).length
const yellowCount = matched.filter(p => p.match_score >= 0.4 && p.match_score < 0.7).length
// Split matches: >= 50% are real matches, < 50% are weak (shown separately)
const realMatched = matched.filter(p => p.match_score >= 0.5)
const weakMatched = matched.filter(p => p.match_score < 0.5)
// Weak matches: GT entries go to "missing", engine entries go to "extra"
const allMissing = [...missing, ...weakMatched.map(w => w.gt_entry)]
const allExtra = [...extra, ...weakMatched.map(w => w.engine_hazard)]
const greenCount = realMatched.filter(p => p.match_score >= 0.7).length
const yellowCount = realMatched.filter(p => p.match_score >= 0.5 && p.match_score < 0.7).length
const tabs: { id: TabType; label: string; count: number; color: string }[] = [
{ id: 'matched', label: `Zugeordnet (${greenCount} exakt, ${yellowCount} aehnlich)`, count: matched.length, color: 'text-green-600' },
{ id: 'missing', label: 'Fehlend', count: missing.length, color: 'text-red-600' },
{ id: 'extra', label: 'Zusaetzlich', count: extra.length, color: 'text-gray-500' },
{ id: 'matched', label: `Zugeordnet (${greenCount} exakt, ${yellowCount} aehnlich)`, count: realMatched.length, color: 'text-green-600' },
{ id: 'missing', label: 'Fehlend', count: allMissing.length, color: 'text-red-600' },
{ id: 'extra', label: 'Engine Findings', count: allExtra.length, color: 'text-blue-500' },
]
return (
@@ -44,9 +51,9 @@ export function HazardComparisonTable({ matched, missing, extra }: Props) {
</div>
<div className="overflow-x-auto">
{tab === 'matched' && <MatchedTable pairs={matched} />}
{tab === 'missing' && <MissingTable entries={missing} />}
{tab === 'extra' && <ExtraTable entries={extra} />}
{tab === 'matched' && <MatchedTable pairs={realMatched} />}
{tab === 'missing' && <MissingTable entries={allMissing} />}
{tab === 'extra' && <ExtraTable entries={allExtra} />}
</div>
</div>
)