Require destination evidence for ticket results
CI / test (push) Successful in 1m17s

This commit is contained in:
m
2026-08-26 04:17:12 +03:00
parent 4d1a579132
commit da5d06895b
4 changed files with 48 additions and 0 deletions
+17
View File
@@ -1818,6 +1818,9 @@ func researchFindingMatchesIntent(query string, finding epistemics.ResearchFindi
if !findingContainsRequestedIdentifier(query, finding) {
return false
}
if ticketSearchQuery(query) && !ticketFindingMatchesDestination(query, finding) {
return false
}
if !nearestFlightQuery(query) {
return true
}
@@ -1847,6 +1850,20 @@ func researchFindingMatchesIntent(query string, finding epistemics.ResearchFindi
return true
}
func ticketSearchQuery(query string) bool {
return interactiondomain.TicketSearchDestination(query) != ""
}
func ticketFindingMatchesDestination(query string, finding epistemics.ResearchFinding) bool {
destination := strings.ToLower(interactiondomain.TicketSearchDestination(query))
if destination == "" {
return true
}
// The source title or URL may describe a category; human-facing proof must
// mention the requested destination in the actual displayed excerpt.
return strings.Contains(strings.ToLower(finding.Excerpt.Text), destination)
}
// findingContainsRequestedIdentifier prevents a generic landing page from
// being presented as a result for a concrete model, article or brand request.
// Identifiers are detected by their syntax, not by a catalogue of providers or