Skip to content

Add shared bounded, compact, and pageable projections to high-volume query outputs #4585

Description

@Widthdom

Summary

Use one projection/pagination framework for definition, find, status, hotspots, references, callers/callees, and impact so callers can request small, bounded responses.

Current v1.38.0 evidence / reproduction

  • Human definition QueryCommandRunner --limit 3 emits roughly 3,140 lines even without --body.
  • find, status, and high-cardinality graph commands do not accept a common JSON byte cap.
  • Hotspots and impact lack compact/field projections.
  • Existing compact definition/graph output reports returned count and truncation but not authoritative total, omitted count, or a stable continuation cursor.

Impact

Terminals, IPC, and AI contexts can be flooded, while clients cannot page through a large result set without gaps.

Suggested direction / acceptance criteria

  • Make definition metadata-only by default; require --body for body excerpts.
  • Share --fields/compact, byte-budget, returned/total/omitted, and stable-cursor semantics across high-volume commands.
  • Ensure expensive bodies/details are not materialized before projection and limit application.
  • Add backward-compatible contract tests for each command family.

Additional consolidated evidence

map --json --limit 80 --path 'src/CodeIndex/**' can still exceed 12k tokens because the limit applies independently to several sections rather than bounding the whole response.

Additional acceptance criterion

  • Include map in the shared response-byte and section-projection framework so a caller can enforce a total response budget.

Dogfooding candidate IDs: Q011, Q032, Q034, Q045, Q048, Q049, Q050, E029. Verified against cdidx v1.38.0 at commit 2919bfc9b1b83cfa7ae1d964845d0f9ffca002d1.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions