Skip to content

Epic: Richer Search Results #66

Description

@prosdev

Overview

Transform dev_search from returning pointers to returning actionable context that LLMs can reason over without additional tool calls.

Motivation

Currently when an LLM calls dev_search("authentication"), it gets:

1. [85%] function: handleAuth (src/auth/handler.ts:45)

Then the LLM has to call read_file to see what that actually is. This means:

  • Extra round-trip latency
  • Extra tokens for the LLM to request the file
  • Fragmented understanding

With richer results, the LLM gets actionable context in one call.

Philosophy

Structured data over summaries — Provide raw data, let LLMs synthesize.

This epic is the foundation for dev-agent's "context quality" initiative (v0.2).

Acceptance Criteria

Before

1. [85%] function: handleAuth (src/auth/handler.ts:45)

After (compact)

1. [85%] function: handleAuth (src/auth/handler.ts:45-67)
   export async function handleAuth(req: Request): Promise<Response> {
     const token = extractToken(req);
     // ... 20 more lines
   }
   Imports: ./service, ../utils/jwt

After (verbose)

{
  "score": 0.85,
  "type": "function",
  "name": "handleAuth",
  "file": "src/auth/handler.ts",
  "lines": [45, 67],
  "snippet": "export async function handleAuth(req: Request)...",
  "imports": ["./service", "../utils/jwt"],
  "exported": true
}

Sub-issues

  • Store code snippets during indexing
  • Track import/export relationships
  • Extend SearchResult type
  • Update MCP formatters
  • Token budget management

Out of Scope

  • Call graph / "what calls this" (future: dev_refs)
  • Codebase skeleton (future: dev_map)
  • Planner refactor (depends on this epic)

Estimate

~1-2 weeks total

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestepicLarge feature spanning multiple issues

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions