Context
The focus command (internal/focus/handler.go) does inline graph traversal to extract a token-efficient context slice for a file — finding defines_function/defines and calls/contains_call edges. Unlike dead-code and blast-radius, there is no dedicated API endpoint for this.
Current state
supermodel focus <file> uses the generic /v1/graphs/supermodel graph and traverses it locally
- Returns functions defined in the file, what they call, and what calls them
Proposal
Either:
- API-side: Add
POST /v1/analysis/focus that returns a pre-built context slice with richer data (types, imports, callers, token estimate)
- CLI-side: Keep using the graph but improve the traversal (it currently misses many functions due to the
defines_function relationship sparsity)
Blocked on
- Decision on whether this warrants an API endpoint or should remain client-side
Context
The
focuscommand (internal/focus/handler.go) does inline graph traversal to extract a token-efficient context slice for a file — findingdefines_function/definesandcalls/contains_calledges. Unlike dead-code and blast-radius, there is no dedicated API endpoint for this.Current state
supermodel focus <file>uses the generic/v1/graphs/supermodelgraph and traverses it locallyProposal
Either:
POST /v1/analysis/focusthat returns a pre-built context slice with richer data (types, imports, callers, token estimate)defines_functionrelationship sparsity)Blocked on