feat(t214): persist candidate observation identities
This commit is contained in:
@@ -98,8 +98,16 @@ func validAIExecutionCandidateCommand() StoreExecutionCandidatesCommand {
|
||||
},
|
||||
Candidates: []ExecutionCandidate{
|
||||
{
|
||||
Ordinal: 1,
|
||||
Title: "拼多多图片候选 1",
|
||||
Ordinal: 1,
|
||||
Title: "拼多多图片候选 1",
|
||||
CardSignature: strings.Repeat("b", 64),
|
||||
DetailSignature: strings.Repeat("c", 64),
|
||||
DetailEvidenceSHA256: strings.Repeat("d", 64),
|
||||
SpecificationEvidenceSHA256: strings.Repeat("e", 64),
|
||||
EvidenceAssetIDs: []string{
|
||||
"00000000-0000-4000-8000-000000000001",
|
||||
"00000000-0000-4000-8000-000000000002",
|
||||
},
|
||||
Evaluation: &CandidateEvaluation{
|
||||
Decision: "REVIEW",
|
||||
Score: 0.9,
|
||||
@@ -129,3 +137,13 @@ func validAIExecutionCandidateCommand() StoreExecutionCandidatesCommand {
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func TestStoreCandidatesRejectsDuplicateEvidenceReferences(t *testing.T) {
|
||||
command := validAIExecutionCandidateCommand()
|
||||
command.Candidates[0].EvidenceAssetIDs[1] =
|
||||
command.Candidates[0].EvidenceAssetIDs[0]
|
||||
|
||||
if err := validateCandidateCommand(command); err == nil {
|
||||
t.Fatal("expected duplicate evidence references to be rejected")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user