Validate internal decisions and reconcile exact model references

This commit is contained in:
2026-11-16 14:11:02 +00:00
parent 475557e4de
commit 0c144fd5a5
46 changed files with 544 additions and 376 deletions

View File

@@ -54,3 +54,21 @@ func (r Request) Preview(candidate proposals.EnrichedCorrectionProposal) proposa
}
return preview
}
// AcceptsIndependentCandidate decides which evidence can be submitted when
// repair needs findings from each applicable validator.
func (r Request) AcceptsIndependentCandidate(validatorName string, modelDriven bool, candidate proposals.EnrichedCorrectionProposal) bool {
hasSpan := candidate.OriginalText != ""
switch validatorName {
case "proposal_shape":
return true
case "no_effect":
return hasSpan
case "original_text_presence":
return hasSpan && candidate.TargetSegmentID > 0
case "protected_terms", "non_empty_resulting_segment":
return r.Preview(candidate).HasResult()
default:
return !modelDriven || r.Preview(candidate).Applicable
}
}