Kalibrierte Scan-Confidence + Cross-Model-Bonus

This commit is contained in:
2026-07-05 20:00:45 +02:00
parent c40531b6ae
commit 538344ca0c
6 changed files with 135 additions and 86 deletions

View File

@@ -1,5 +1,13 @@
const { normalizeText } = require('./scanGrounding');
const clamp = (value, min, max) => Math.min(max, Math.max(min, value));
// Two DIFFERENT models independently naming the same species is genuine
// evidence beyond either model's self-reported confidence, so agreement
// earns a bonus on top of the better single estimate.
const REVIEW_AGREEMENT_BONUS = 0.2;
const REVIEW_AGREEMENT_CONFIDENCE_CAP = 0.97;
// Agreement must be judged on the RAW model answers, not the grounded ones:
// catalog grounding has a genus-level fallback that can collapse two different
// species onto the same catalog entry and fake an agreement.
@@ -30,6 +38,11 @@ const decideReviewOutcome = ({ primaryResult, reviewResult, agrees }) => {
accept: true,
replace: reviewConfidence >= primaryConfidence,
reason: 'review-confirmed-primary',
confidence: clamp(
Math.max(primaryConfidence, reviewConfidence) + REVIEW_AGREEMENT_BONUS,
0.05,
REVIEW_AGREEMENT_CONFIDENCE_CAP,
),
};
}