feat(graph-viewer): surface API/syscall calls with decoded args#15
Merged
Conversation
The behavior-graph JSON keeps each resolved API/syscall call (with its decoded arguments, return value, category and sequence) in a separate top-level `events` array; the viewer only read `nodes`/`links`, so an api node showed its name but never its arguments. Read `events` and add: - an "API calls" sidebar panel listing every call as `#seq name [category] args -> ret`, shown only when the JSON carries events; - click a row to center and highlight the matching api/syscall node; - enrich the node tooltip with each decoded call (`name(args) -> 0xret`). Falls back to synthesizing `name(args)` when a producer omits the one-line `log`. Pure addition — no change to existing node/link/edge rendering. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Why
The behavior-graph JSON keeps each resolved API/syscall call — with its decoded arguments, return value, category and sequence — in a separate top-level
eventsarray (seeBehaviorGraph.to_json). The viewer only consumednodes/links, so anapi/syscallnode showed its name (GetCurrentProcess,OpenProcessToken) but never its arguments. This makes the args visible.What
Reads
data.eventsand adds (all pure additions — existing node/link/edge rendering is untouched):#seq name [category] args -> ret, shown only when the JSON carries events.api:<name>andsyscall:<name>nodes resolve).name(args) -> 0xret).Field handling matches the serializer (
graph.py): each event hasseq,kind("api"/"syscall"),name,site, pluscategory/args/ret/logfrom the probes. When a producer omits the one-linelog, the viewer synthesizesname(args)fromargs.Validation
No JS runtime in CI for this file, so checked locally:
node --checkon the extracted inline script passes, and a smalld3/document-stub harness run ofbuildApiLog()against events mirroring the serializer output renders e.g.:with the panel shown, the count set, and
EVENTS_BY_NAMEindexed by name.Follow-up to #12 (this tool).
🤖 Generated with Claude Code