Repository navigation
Traversal v1 (4/4): Python client methods and traverse.md - #711
Open
adamant-pwn wants to merge 40 commits into
Open
adamant-pwn wants to merge 40 commits into
adamant-pwn wants to merge 40 commits into
Conversation
Last piece of the labeled-traversal v1 stack. - GraphClientJson.resolve() / .traverse() and their GraphClient wrappers: the /resolve and /traverse requests of a server started with --experimental-traverse, returning the parsed JSON. - docs/traverse.md: the routes, the CLI, the v1 request and response schemas, the walk rule, the end reasons and the bounds. - An integration test of the client against the server. Based on the traverse.md of #670 (metagraph/docs/traverse.md); the request and response fields from d5d26ba metagraph/src/cli/traverse.cpp. Co-authored-by: Gunnar Rätsch <Gunnar.Ratsch@ratschlab.org> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…se.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
traverse.md: the split limit ends a path with max_splits_per_path and truncates the arm; max_output_bp is gone; seed label lists are capped at 100,000 and the time budget is at least 1 ms. The GraphClient resolve and traverse wrappers now pass timeout to GraphClientJson. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nt test Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adamant-pwn
marked this pull request as ready for review
November 9, 2026 02:22
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Architecture diagram
sequenceDiagram
participant User as Python User
participant GC as GraphClient
participant GCJ as GraphClientJson
participant HTTP as HTTP Layer (_do_request)
participant Server as Server (--experimental-traverse)
participant Routes as /resolve, /traverse Routes
participant Index as Graph Index + Annotation
Note over User,GC: NEW: Python client methods for labeled traversal
User->>GC: resolve(sequence, labels/discover, select)
GC->>GCJ: resolve(sequence, labels, discover, select)
GCJ->>GCJ: Build payload {sequence, labels|discover, select}
Note over GCJ: Exactly one of labels/discover
GCJ->>HTTP: _do_request('resolve', payload)
HTTP->>Server: POST /resolve
Server->>Routes: Route request
Routes->>Index: Resolve labels on sequence
Index-->>Routes: Support profile + seeds
Routes-->>Server: JSON response
Server-->>HTTP: Response
HTTP-->>GCJ: json_obj
GCJ-->>GC: Support profile dict
GC-->>User: Profile with selection
User->>GC: traverse(seeds, strategy)
GC->>GCJ: traverse(seeds, strategy)
GCJ->>GCJ: Build payload {seeds, strategy?}
GCJ->>HTTP: _do_request('traverse', payload)
HTTP->>Server: POST /traverse
Server->>Routes: Route request
Routes->>Index: Walk seeds under labels
Index-->>Routes: Extension results per seed
Routes-->>Server: JSON response
Server-->>HTTP: Response
HTTP-->>GCJ: json_obj
GCJ-->>GC: Results dict
GC-->>User: Results
alt Invalid strategy field
User->>GC: traverse(seeds, {unknown: 1})
GC->>GCJ: traverse(seeds, strategy)
GCJ->>HTTP: _do_request('traverse', payload)
HTTP->>Server: POST /traverse
Server->>Routes: Validate schema
Routes-->>Server: HTTP 400
Server-->>HTTP: Error response
HTTP-->>GCJ: Raise RuntimeError
GCJ-->>GC: Exception propagates
GC-->>User: RuntimeError raised
end
Note over User,Index: Routes gated unless server started with --experimental-traverse
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Turn on auto-fix | Re-trigger cubic
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
All reported issues were addressed across 1 file (changes from recent commits).
Shadow auto-approve: would not auto-approve because issues were found.
View guided diff | Turn on auto-fix | Re-trigger cubic
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.
Last of four stacked PRs for labeled traversal, on #710.
This PR adds
GraphClient.resolve()andGraphClient.traverse()to the Python client, andmetagraph/docs/traverse.md. The document covers the routes and the CLI, the request and response schemas, the walk rule, the end reasons, the bounds and what version 1 leaves out ofgr/labeled-traversal. An integration test runs the client against a server.No caller uses the client methods yet: the staging service calls the HTTP routes directly. They give Python users the same access to the experimental routes that
search()andalign()give to the others.Co-authored-by: Gunnar Rätsch
🤖 Generated with Claude Code