feat(cli): add symbols/refs/cfg/callgraph/cost query commands - #440
Merged
Merged
Conversation
The semantic query surface the agent contract already served is now reachable from the CLI: each new command runs its operation through the session's ToolService, so a CLI result equals the agent payload for the same input. - ToolRequest symbol/rule fields accept a numeric id or the declared name (untagged Address); names resolve against the shared SemanticIndex in the analyzer, and unmatched/ambiguous names are structured unknown-symbol/ambiguous-symbol/unknown-rule/ambiguous-rule errors instead of guesses. Symbol ids and rule indexes stay separate spaces. - wright refs <NAME> is the usage payload plus the references list; wright cfg <RULE> addresses rules by name. symbols gains --only <KIND> for the symbol-kind filter since --kind already selects the input frontend. cost honors the shared finding selection. - usage echoes the resolved id/kind (additive wright-agent/v1 field); analyze gains facts.persistentObjects; inspect names the detail command per area. - Schema, agent contract, and CLI docs updated; wright-bench call sites use the Address form. Closes #429 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
#439 keeps the top-level command surface to distinct user intents and assigns the semantic query surface to `inspect` (#429). Move the five flat commands into inspect subcommands — inspect symbols|refs|cfg|callgraph|cost — keeping the same agent-backed payloads, the --only filter, name addressing, and finding selection. Bare `inspect` still prints the summary, which now points to the nested detail commands; mixing an [INPUT] positional with a query subcommand is a usage error rather than a silent merge. Refs #429, #439 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Teakowa
enabled auto-merge (squash)
September 29, 2026 20:53
Teakowa
approved these changes
Sep 29, 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.
Summary
Implements #429: the semantic query surface previously reachable only through
wright serve/wright-agent/v1is now exposed to humans, nested underinspectper #439's top-level-surface principle ("#429 owns theinspectquery surface").wright inspectkeeps the bounded summary; its subcommands expose the detail areas —inspect symbols [INPUT] [--only KIND],inspect refs <NAME> [INPUT],inspect cfg <RULE> [INPUT],inspect callgraph [INPUT],inspect cost [INPUT]. Each runs its agent operation (symbols,references+usage,cfg,callGraph,costEstimate) through the session'sToolService, so CLIresultpayloads equal the agent payloads by construction.refsreports theusagecounts as the header of the reference list;costhonors the shared finding-selection options. Mixing an[INPUT]positional with a query subcommand is a usage error.--kindsymbol-kind filter collides with the existing--kindinput-frontend flag, so the filter is spelled--only(inspect symbols --only rule), per maintainer direction on the simpler name.references.symbol,usage.symbol, andcfg.ruleaccept a numeric id or the declared name (untaggedAddress; schemainteger|string). Names resolve through the analyzer'sSemanticIndexinside the driver — callers never learn the program's numbering, where symbol ids and rule indexes are different spaces. Unknown/ambiguous names return structuredunknown-symbol/ambiguous-symbol/unknown-rule/ambiguous-ruleerrors listing candidate ids; resolution never guesses.usageadditively echoes the resolvedid/kind.result.facts.persistentObjectscarries the same factspersistentObjectsserves (with resolved span paths); the text overview reports the count.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features </dev/null— all 31 test targets passgit diff --checkanalyzereportsfacts.persistentObjects--onlyfilter, usage header counts, callgraph edge, exact cost counts + selection, unknown/ambiguous diagnostics, bare-inspectdetail-command pointers, top-level/inspect --helpcoveragewright-agent/v1validates integer and string address spellings, rejects other types;UsageResult/AnalyzeResultvalidated against live responsesoverpy-cake.ws— cakePos 16 reads / 1 write / 17 references, cfg 18 blocks, cost 3960 bytes / 29 actions / 2 rules / 1 waitGenerated with Devin