Goal
Expose Wright's existing project-semantic query capabilities through the CLI without expanding the top-level command inventory for each query primitive.
Humans and agents should reach the same underlying semantic services through one coherent inspect workflow.
Context
Wright already exposes semantic queries such as symbols, references, usage, CFG, call graph, cost estimates, and persistent-object facts through wright-agent/v1, while the CLI currently exposes only the broader wright inspect summary.
The agent contract also addresses some query targets through session-local numeric ids. Those ids are awkward for direct CLI use and create two numbering spaces for related concepts. Name-based addressing is the appropriate shared user-facing contract where names are unambiguous.
Top-level CLI commands should represent distinct user intents rather than every semantic primitive. Detailed semantic queries are variants of the existing inspection workflow and therefore belong under wright inspect.
Scope
Extend wright inspect with focused query subcommands:
| CLI surface |
Existing agent operation |
wright inspect symbols [INPUT] |
symbols |
wright inspect refs <NAME> [INPUT] |
references + usage |
wright inspect cfg <RULE> [INPUT] |
cfg |
wright inspect callgraph [INPUT] |
callGraph |
wright inspect cost [INPUT] |
costEstimate |
- Keep plain
wright inspect [INPUT] as the overview entry point.
refs absorbs usage counts rather than creating a separate usage CLI command.
- Fold persistent Workshop object facts into the existing
analyze report rather than creating another inspection subcommand unless a distinct user workflow later requires one.
- Add name addressing to the shared driver/analyzer model and to
references, usage, and cfg on wright-agent/v1; retain existing numeric addressing for compatibility.
- Unmatched or ambiguous names must return structured diagnostics rather than guessing or silently succeeding.
- Every inspection subcommand accepts the relevant existing common options and emits the normal
wright-result/v1 envelope under --format json.
- CLI and agent surfaces must use the same underlying query/result model rather than implementing independent query logic.
- The overview output/help should make the detailed
inspect subcommands discoverable.
Non-goals
- Adding
symbols, refs, cfg, callgraph, or cost as top-level commands.
- Adding a separate generic
query top-level namespace.
targetMetadata; it is project-independent catalog data and should be handled through the appropriate catalog/product surface separately.
- Removing or changing existing numeric addressing on
wright-agent/v1.
- Adding session reload/incremental-state machinery solely for these queries.
- Adding new semantic analysis; this issue exposes capabilities Wright already computes.
- Redesigning unrelated top-level workflow commands.
Acceptance criteria
Dependencies / ownership
Goal
Expose Wright's existing project-semantic query capabilities through the CLI without expanding the top-level command inventory for each query primitive.
Humans and agents should reach the same underlying semantic services through one coherent
inspectworkflow.Context
Wright already exposes semantic queries such as symbols, references, usage, CFG, call graph, cost estimates, and persistent-object facts through
wright-agent/v1, while the CLI currently exposes only the broaderwright inspectsummary.The agent contract also addresses some query targets through session-local numeric ids. Those ids are awkward for direct CLI use and create two numbering spaces for related concepts. Name-based addressing is the appropriate shared user-facing contract where names are unambiguous.
Top-level CLI commands should represent distinct user intents rather than every semantic primitive. Detailed semantic queries are variants of the existing inspection workflow and therefore belong under
wright inspect.Scope
Extend
wright inspectwith focused query subcommands:wright inspect symbols [INPUT]symbolswright inspect refs <NAME> [INPUT]references+usagewright inspect cfg <RULE> [INPUT]cfgwright inspect callgraph [INPUT]callGraphwright inspect cost [INPUT]costEstimatewright inspect [INPUT]as the overview entry point.refsabsorbs usage counts rather than creating a separateusageCLI command.analyzereport rather than creating another inspection subcommand unless a distinct user workflow later requires one.references,usage, andcfgonwright-agent/v1; retain existing numeric addressing for compatibility.wright-result/v1envelope under--format json.inspectsubcommands discoverable.Non-goals
symbols,refs,cfg,callgraph, orcostas top-level commands.querytop-level namespace.targetMetadata; it is project-independent catalog data and should be handled through the appropriate catalog/product surface separately.wright-agent/v1.Acceptance criteria
wright inspect symbols,refs,cfg,callgraph, andcostrun against a file or project directory and preserve the normal current-directory default.wright inspectremains the overview workflow.wright inspect refs <NAME>resolves a symbol by name and includes the usage counts currently exposed separately by the agentusageoperation.wright inspect cfg <RULE>resolves a rule by name rather than requiring a numeric rule index.references,usage, andcfgaccept name addressing onwright-agent/v1; existing numeric requests continue to produce their current results.wright analyzeexposes persistent Workshop object facts while the existing agent operation continues to return the same data.wright inspect --helpand the overview output make the detailed inspection surfaces discoverable without adding top-level commands.Dependencies / ownership
wright-cli,wright-driver,wright-analyzer, agent contract, docs).