Repository navigation
Port over ARAX xCRG and update to TRAPI 2.0 - #174
Merged
Merged
Conversation
ARAX's connect(action=xcrg) called catrax-xcrg, which is TRAPI 1.x throughout:
it read qualifiers from qualifier_constraints, so every 2.0 MVP2 query failed
with "Phase-one inferred xCRG requires increased/decreased directionality"
(HTTP 500).
xCRG is now vendored at shepherd_utils/arax/xcrg/ from Translator-CATRAX/xCRG
@ e67f2c0 (its latest commit, which RTX master pins) and moved from
translator_tom 1.2.1 to Shepherd's 2.2 (TRAPI 2.0): constraints.qualifiers,
one {ids} binding per qnode/qedge, knowledge_level/agent_type as edge members,
no aux-graph attributes. Shepherd changes on top, listed in each file's
header: lookups send parameters.timeout/tiers; a query dict is read for its
query graph only; the NGD/PMID readers also accept Shepherd's v1.0 artifact
formats; unknown KL/AT values don't crash the ranker; NaN values survive; a
direct lookup filters on its own qedge. Only inferred MVP2 queries route to
xCRG, so one-hop lookups keep ARAX's Expand path.
The mvp2_xcrg_route parity case now runs: same answers, bindings, KG, support
graphs and Retriever lookups as upstream; order, scores and logs differ (the
newer ranker). Adds xCRG's own unit tests (xcrg_suite/), test_xcrg.py, and
DEC-21 in the baseline doc.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
The ARAX port validates /arax/response/{id} as TRAPI 2.0 with translator_tom
through a stand-in (ResponseCache/response_lookup.py); reasoner-validator only
knows TRAPI <= 1.6 and nothing imports it anymore. Remove it from the arax-api
extra and update the docs that still described it as installed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
A TRAPI qnode given only by name failed with QueryGraphNoIds: ARAX accepts the name but never resolves it. ARAXQuery now resolves a qnode with a name and no ids the way ARAXi's add_qnode(name=...) does (NodeSynonymizer: Name Resolver, then the Node Normalizer), in one lookup for all named qnodes; an unknown name is ARAXi's UnresolvableNodeName error. Set qnodes need no change to match ARAX: like upstream, the port forwards set_interpretation and member_ids to the KP (the trapi_set_interpretation_all golden shows it) and does no set logic itself. Retriever does not support set queries, so those answers are empty. Corrects D-25 and the docs, which said member_ids were not forwarded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
--target arax sends each case's TRAPI 2.0 query in its 1.6 form (parameters.log_level/bypass_cache become top-level fields, timeout is dropped, constraints.qualifiers/attributes become qualifier_constraints/ attribute_constraints, required_intermediate_categories becomes intermediate_categories, COLLATE becomes is_set). Responses are checked to be TRAPI 1.x, then raised to 2.0 with translator_tom's dict converter so the existing checks read them. Cases where Shepherd deliberately differs carry upstream's expectation (QueryGraphNoIds for a qnode name, MissingQEdgeAndQPath, rtx-kg2 for single-node queries, log_level ignored); cases that only test Shepherd (its 400 for TRAPI 1.x spellings, the UI's X prefix) are skipped. Autocomplete is called on the API's host, as the UI does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
…process ARAX Sets parameters.arax_internal: true on every query, so the arax worker runs its ARAX port whatever ARAX_INTERNAL_DEFAULT says. Without it, a worker on the default legacy path proxies to the remote ARAX service, whose TRAPI 1.6 answers fail the script's 2.0 checks. Refused with --target arax. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
… cases
- message_uris on a stored 2.0 response failed in filter_results' prune_kg
("'NoneType' object has no attribute 'items'"): TRAPI 2.0 omits an empty
auxiliary_graphs, so the loaded message had None where upstream's actions
expect a dict. ARAXQuery now restores the empty auxiliary_graphs /
knowledge_graph.edges on the message a plan starts from; the 2.0 envelope
drops them again on the way out.
- ARAX's own log entries ignored parameters.log_level: the worker put them in
the query's log store unfiltered. save_arax_logs now keeps only entries at or
above the task logger's level, as Shepherd's own records are.
- test_arax_queries: lookup_single_node is TRAPI 2.0's one-node query graph (no
edges; 1.6's edges: {} for --target arax) instead of an empty edges map,
which 2.0 forbids; val_no_edges_or_paths becomes val_empty_edges (Shepherd's
400 for that empty map). dsl_overlay_clinical_info is a known defect (D-29:
a live cohd.io call). A Retriever 422 on a hop prints the
OPENAPI__X_TRAPI__BATCH_SIZE_LIMIT hint.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
…ARNINGs lookup_three_hop's FET error came after 10,000 aux-graph warnings, so the 12 lines printed were all warnings and the traceback that explains the failure was cut. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
Found by test_arax_queries' lookup_three_hop against a live Retriever: an unbound (support-graph) edge whose qnode-bound endpoint _remove_dead_end_paths later prunes is merged back into the KG without that node, and the three-hop template's Fisher's exact test fails with a KeyError on it. Same code on RTX master; kept as upstream does it (DEC-1) and recorded in Part D, with the fix noted. lookup_three_hop is now an expected failure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y9aBGnboPGSDF9Goh7eqap
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.
No description provided.