Skip to content

Excerpt and body JSON should expose effective ranges and truncation recovery #3562

Description

@Widthdom

Summary

Excerpt-style outputs report content and a truncation boolean, but they do not say exactly which requested range was clamped or how to fetch the omitted body/range.

Current source evidence

  • RunExcerpt serializes FileExcerptResult with StartLine, EndLine, Content, and ContentTruncated.
  • BuildSymbolBodyExcerpt, BuildBodyExcerpt, and definition body paths cap body ranges and set truncation booleans.
  • Body truncation can come from line caps, line-width caps, or byte caps, but that reason is not exposed.

Proposed improvement

Add requested/effective range fields and truncation reasons such as line_range_cap, line_width_cap, body_line_cap, and body_byte_cap. Include a replayable follow-up command or cursor for the next body/range chunk.

Acceptance notes

  • Existing content_truncated / body_content_truncated remains.
  • Clients can retrieve omitted content without guessing line ranges.
  • Tests cover line cap and byte cap truncation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions