feat(matching): rank with semantic embeddings and explain matches by evidence

This commit is contained in:
shira committed 2026-10-11 10:39:46 +03:00
1 parent facc1789b1
commit 24b64d698a
215 files changed
+16951 -327

No files matched your search

@@ -33,7 +33,7 @@ var (
hiddenSchemas = []string{"HiddenOrganization", "HiddenOrganizationList", "PrivacyOrganization"}
privacyOnlySchemas = []string{
"PrivacySettings", "CardPreview", "AnonymousCardContent", "CardCategory", "CardCategoryStrength", "CardSelfAssessment",
"CardSelfAssessmentConfirmationStatus",
"CardSelfAssessmentConfirmationStatus", "CardProject",
"CandidateExperienceBand", "CandidateWorkFormat", "CandidateSalaryCompatibility",
"PrivacyEvent", "PrivacyEventKind", "PrivacyEventList", "CardAccess", "CardAccessKind", "CardAccessList",
}
@@ -218,14 +218,14 @@ func TestPublicationAndSearchStatusAreNotConsents(t *testing.T) {
fields := enumValues(t, resolveSchema(t, spec, &ogen.Schema{Ref: "#/components/schemas/CardField"}))
want := []string{
"categories", "stack", "experience", "soft_skills", "location", "relocation",
"self_assessment", "work_formats", "salary_compatibility",
"self_assessment", "work_formats", "salary_compatibility", "projects",
}
slices.Sort(fields)
slices.Sort(want)
if !slices.Equal(fields, want) {
t.Errorf("CardField = %v, want %v", fields, want)
}
if update := spec.Components.Schemas["CardFieldSet"]; update.UniqueItems != true || update.MaxItems == nil || *update.MaxItems != 9 {
if update := spec.Components.Schemas["CardFieldSet"]; update.UniqueItems != true || update.MaxItems == nil || *update.MaxItems != 10 {
t.Error("CardFieldSet must hold distinct items and at most one per field")
}
status := enumValues(t, resolveSchema(t, spec, &ogen.Schema{Ref: "#/components/schemas/SearchStatusValue"}))
@@ -246,7 +246,7 @@ func TestAnonymousCardReachesNoProfileOrContactSchema(t *testing.T) {
t.Fatal("the contract has no AnonymousCardContent")
}
if got, want := propertyNames(card), []string{
"categories", "experience_band", "pseudonym", "salary_compatibility", "self_assessment", "stack", "work_formats",
"categories", "experience_band", "projects", "pseudonym", "salary_compatibility", "self_assessment", "stack", "work_formats",
}; !slices.Equal(got, want) {
t.Errorf("AnonymousCardContent properties = %v, want %v", got, want)
}
@@ -269,7 +269,7 @@ func TestAnonymousCardReachesNoProfileOrContactSchema(t *testing.T) {
allowed := slices.Concat([]string{
"AnonymousCardContent", "CardCategory", "CardCategoryStrength", "CardSelfAssessment", "CardSelfAssessmentConfirmationStatus", "CandidateExperienceBand", "CandidateWorkFormat",
"CandidateSalaryCompatibility", "CardField", "CardFieldSet", "PublicationState", "SpecializationCode",
"GradeCode", "StackTag", "Timestamp", "CardPreview",
"GradeCode", "StackTag", "Timestamp", "CardPreview", "CardProject",
}, previewEvidenceSchemas)
for _, name := range []string{"AnonymousCardContent", "CardPreview"} {
for reached := range reachableSchemas(index, mustJSONValue(t, spec.Components.Schemas[name])) {
@@ -323,7 +323,7 @@ func TestAnonymousCardReachesNoProfileOrContactSchema(t *testing.T) {
slices.Contains([]string{
"AnonymousCardContent", "CardCategory", "CardCategoryStrength", "CardSelfAssessment",
"CardSelfAssessmentConfirmationStatus", "CandidateExperienceBand", "CandidateWorkFormat",
"CandidateSalaryCompatibility",
"CandidateSalaryCompatibility", "CardProject",
}, reached) {
continue
}