Repository navigation
Conversation
This was referenced Sep 30, 2026
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.
Second of three stacked PRs for ARS querying. Adds Autonomous Relay System querying to the library, built on @gloriachin's
feat/ars-query-supportbranch, with merge-aware polling ported from @hodgesf'sfeat/ars-client. Follows the finder conventions landed in #44/#48.Stacked on #64. The MCP/CLI tool PR stacks on this one.
What changed
TCT/Query_ARS.py:ARS_neighborhood_finder(node, neighbor_categories, json_file=...)and the newARS_pathfinder(start, end, intermediate_categories, json_file=...)build one-hop and paths TRAPI queries, submit them to the ARS, wait for every ARA and the merge agent, and return anARSResult.json_filepasses an uploaded TRAPI query through unchanged (edges or paths query graphs). Guangrong's public names are kept:Query_ARS,check_ars_results,fetch_ars_results,format_query_json_forARS_neighborhood.ARSResultextendsFinderResultwithpk,merged_pk,status(anARSStatus), andsummarize(top_n), which returns ranked rows: essence, bound nodes with names, predicates, primary sources, contributing ARAs.isinstance(r, FinderResult)holds, so existing consumers of.rawand.knowledge_graphwork unchanged. The merged ARS TRAPI is kept as the ARS returns it, with its own ranking and ARA attribution.json_fileskips resolution.ars-ars-agentmerge child (ARS delay in saving "Done" status on merged result Relay#621) and parses the Python-reprmerged_versions_listthe ARS actually sends. It uses a deadline instead of retry-count arithmetic and one sharedrequests.Session.config.py: newarsendpoint for prod, ci, and test, selected byTCT_ENVIRONMENTorTCT.configure()(default ci, as before). This replaces the hardcoded URLs from the original branch. TheQuery_ARSfunction is not re-exported fromTCT, because that would shadow theTCT.Query_ARSmodule.DEFAULT_ENVIRONMENT, which the nodenorm change dropped because it was written against an older base.notebooks/Test_ARS.ipynbgains pathfinder cells and was re-executed end to end. Newdocs/source/ars.rst; README tool table updated.Stats (for audit)
TCT_LIVE_ARS=1).tests/test_query_ars.py(Guangrong's uploaded-JSON and notebook-parity cases, plus merge-wait, finder-parity, and summarizer coverage) and 14 node-normalizer routing cases from his branch.merged_versions_listas a Python-repr string, and aragorn/bte merges omitessenceandrank.Performance (old branch vs this PR, same live CI query: asthma, ChemicalEntity)
Verification
uv run pytest: 157 passed, 4 skipped.TCT_LIVE_ARS=1 uv run pytest tests/test_ars_live.py -v: 3 passed in 199.00 s.ARS_neighborhood_finder("asthma", ["ChemicalEntity"])returned 476 results andARS_pathfinder("asthma", "albuterol", intermediate_categories=["Gene"])returned 1 path. Both reached Done, andisinstance(r, FinderResult)was True.