Skip to content

unused_symbols JSON output omits documented reason taxonomy #1633

Description

@Widthdom

Summary

UnusedSymbolResult exposes UnusedBucket (likely_unused_private / maybe_unused_nonpublic / public_or_exported_no_refs / reflection_or_config_suspect), UnusedConfidence, and UnusedReason fields on the model. The classification logic exists (closed #105), but the MCP / --json response shape does not document the taxonomy — clients see opaque enum strings with no per-bucket explanation. Adding a --by-bucket aggregator and an explicit reason-taxonomy schema would make the output far more usable for automation.

This is distinct from #1403 (false-positive on same-file private), #1405 (BCL dominance in hotspots), and closed #105 (implementation of classification). C231 is about exposing the existing taxonomy through a documented schema.

Where

  • src/CodeIndex/Models/QueryResults.cs:39-44 (UnusedSymbolResult fields)
  • src/CodeIndex/Mcp/McpToolHandlers.cs:1444-1447 (response serialization)

Suggested approach

(1) Document the bucket enum values in USER_GUIDE.md and the MCP tool description. (2) Add an aggregator field summary: { by_bucket: {...}, by_confidence: {...} } to the JSON envelope. (3) Add --exclude-tests, --bucket=… filter flags so callers can drill into one classification at a time without re-querying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions