2026-11-11 04:23:34 +00:00
|
|
|
package runner
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposal_generation"
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/proposals"
|
|
|
|
|
"gitea.maximumdirect.net/eric/audita/v3/internal/framework/validators"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// feedbackCandidates submits only candidates for which the validator has usable evidence.
|
2026-11-16 14:11:02 +00:00
|
|
|
func feedbackCandidates(input validateSectionCandidatesInput, validatorName string, modelDriven bool, noEffect map[int]bool, evidence validators.Request) []proposals.EnrichedCorrectionProposal {
|
2026-11-11 04:23:34 +00:00
|
|
|
var result []proposals.EnrichedCorrectionProposal
|
|
|
|
|
for _, candidate := range input.SectionEnriched {
|
|
|
|
|
if noEffect[candidate.ProposalIndex] {
|
|
|
|
|
continue
|
|
|
|
|
}
|
2026-11-16 14:11:02 +00:00
|
|
|
if evidence.AcceptsIndependentCandidate(validatorName, modelDriven, candidate) {
|
2026-11-11 04:23:34 +00:00
|
|
|
result = append(result, candidate)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// repairFindings extracts ordered, safe feedback for one candidate version.
|
|
|
|
|
func repairFindings(index int, rejected []ValidatorRejectedChange) []proposal_generation.RepairFinding {
|
|
|
|
|
var findings []proposal_generation.RepairFinding
|
|
|
|
|
for _, decision := range rejected {
|
|
|
|
|
if decision.ProposalIndex != index {
|
|
|
|
|
continue
|
|
|
|
|
}
|
|
|
|
|
finding := proposal_generation.RepairFinding{Validator: decision.ValidatorName, Reason: decision.ReasonCode, Explanation: decision.Message}
|
|
|
|
|
if decision.Disposition == validators.DispositionUnavailable {
|
|
|
|
|
finding.Status = "unavailable"
|
|
|
|
|
finding.Explanation = "assessment was unavailable"
|
|
|
|
|
}
|
|
|
|
|
findings = append(findings, finding)
|
|
|
|
|
}
|
|
|
|
|
return findings
|
|
|
|
|
}
|