fix(session-search): label discovery result route scope - #86603
Open
moeedahmed wants to merge 1 commit into
Open
fix(session-search): label discovery result route scope#86603moeedahmed wants to merge 1 commit into
moeedahmed wants to merge 1 commit into
Conversation
Collaborator
Contributor
fix(session-search): label discovery result route scope
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
session_searchdiscovery can return semantically identical history from several messaging routes, but today the model receives no trusted relationship between each result and the current conversation. That makes it easy to import another topic's task or reset state into the current topic.This change uses the
current_session_idand session DB already owned by the tool to add one model-safe field to each discovery result:current_route— the result belongs to the same canonical conversation routeother_route— it belongs to a different routeunknown— the relationship cannot be provedThe persisted route keys are compared internally and never serialized. Missing rows, missing keys, cross-profile reads, and lookup failures fail closed to
unknown. The tool description also makes clear that same-route history is still historical context and cannot prove current state or a user-issued/reset.No new tool, config, service, store, model call, or serialized route identifier is added.
Related Issue
No linked issue; this PR includes a deterministic regression reproducer.
Type of Change
Changes Made
tools/session_search_tool.py: classify discovery results against the current route without exposing persisted keys; document the evidence limit.tests/tools/test_session_search.py: cover identical prompts across routes, same-route history, missing evidence, and route-key non-disclosure.How to Test
scripts/run_tests.sh tests/tools/test_session_search.py.scripts/run_tests.sh tests/hermes_cli/test_web_server_session_search.py.scripts/run_tests.sh tests/tools/and compare any unrelated failures with cleanorigin/main.Checklist
Code
origin/maincurrently has unrelated tool-suite failures in this environment; the touched-area suite is green and the same broader failures reproduced unchanged on a detached baselineDocumentation & Housekeeping
Screenshots / Logs
A read-only canary against the commissioning session's real history returned four duplicate-text matches and classified them as one
current_routeand threeother_route, with no route-key fields serialized.Focused verification: 47 tests passed across the session-search tool and web-server integration files, including fail-closed coverage for keyless lineage children, lookup errors, and cross-profile reads. The broader
tests/tools/suite produced the same 69 unrelated failures in 16 files on both this branch and a clean detachedorigin/mainbaseline.