Kalibrierte Scan-Confidence + Cross-Model-Bonus
This commit is contained in:
@@ -82,6 +82,35 @@ describe('decideReviewOutcome', () => {
|
||||
expect(decision.reason).toBe('review-confirmed-primary');
|
||||
});
|
||||
|
||||
it('boosts confidence when two different models agree on the species', () => {
|
||||
// The 55%-forever bug: primary 0.55 + agreeing review 0.54 must NOT stay
|
||||
// at 0.55 — independent cross-model agreement is real evidence.
|
||||
const decision = decideReviewOutcome({
|
||||
primaryResult: ai('Sacred lotus', 'Nelumbo nucifera', 0.55),
|
||||
reviewResult: ai('Sacred lotus', 'Nelumbo nucifera', 0.54),
|
||||
agrees: true,
|
||||
});
|
||||
expect(decision.confidence).toBeCloseTo(0.75, 5);
|
||||
});
|
||||
|
||||
it('caps the agreement-boosted confidence at 0.97', () => {
|
||||
const decision = decideReviewOutcome({
|
||||
primaryResult: ai('Sacred lotus', 'Nelumbo nucifera', 0.95),
|
||||
reviewResult: ai('Sacred lotus', 'Nelumbo nucifera', 0.9),
|
||||
agrees: true,
|
||||
});
|
||||
expect(decision.confidence).toBe(0.97);
|
||||
});
|
||||
|
||||
it('gives no confidence bonus on disagreement', () => {
|
||||
const decision = decideReviewOutcome({
|
||||
primaryResult: ai('Rose', 'Rosa chinensis', 0.5),
|
||||
reviewResult: ai('Sacred lotus', 'Nelumbo nucifera', 0.6),
|
||||
agrees: false,
|
||||
});
|
||||
expect(decision.confidence).toBeUndefined();
|
||||
});
|
||||
|
||||
it('replaces with the agreeing review on a confidence tie (stronger model wins ties)', () => {
|
||||
const decision = decideReviewOutcome({
|
||||
primaryResult: ai('Swiss Cheese Plant', 'Monstera deliciosa', 0.7),
|
||||
|
||||
Reference in New Issue
Block a user