Align validator identity and span domain checks

This commit is contained in:
2026-09-25 02:48:57 +00:00
parent 31979d4081
commit 640f663ace
19 changed files with 148 additions and 49 deletions

View File

@@ -46,13 +46,17 @@ func TestValidateProtectedTermsAppliesToNonGlossaryModule(t *testing.T) {
},
ProposalMetadata: proposals.ProposalMetadata{ProposalIndex: 0},
},
{
CorrectionProposal: proposals.CorrectionProposal{TargetSegmentID: 1, OriginalText: "Jesters", CorrectedText: "", Confidence: 0.9},
ProposalMetadata: proposals.ProposalMetadata{ProposalIndex: 1},
},
},
}
res, err := ValidateProtectedTerms(req, false)
if err != nil {
t.Fatalf("validator error: %v", err)
}
if len(res.Decisions) != 1 || res.Decisions[0].Approved {
if len(res.Decisions) != 2 || res.Decisions[0].Approved || res.Decisions[1].Approved || res.Decisions[1].ReasonCode != ReasonProtectedGlossaryTerm {
t.Fatalf("expected protected-term rejection, got %+v", res.Decisions)
}
}