Skip to content

Add a byte budget to outline JSON #4880

Description

@Widthdom

Summary

Outline can paginate hundreds of symbols but does not accept --max-json-bytes, so one page or one large symbol can exceed an AI/client response budget.

Audit IDs: Q-19. Reproduced with locally built cdidx v1.40.3 at 404db09489c305f17d94f37026e00564d3ac527a.

Existing issue relationship

No exact issue covers outline byte budgeting; this follows the repository's existing bounded-output contracts.

Expected behavior and PR scope

Outline should use the common whole-row JSON byte-budget envelope with continuation and minimum-budget diagnostics. Keep this CLI-outline-specific; MCP outline controls are separate.

Implementation guide for Codex 5.6 sol xhigh

  • Measure UTF-8 bytes before committing each complete row/section and never cut JSON syntax or strings.
  • Preserve hierarchy/order across page boundaries and expose total/returned/omitted/has_more/cursor.
  • Return the common typed minimum-budget error when even the required envelope/row cannot fit.
  • Cover large signatures, deep trees, Unicode, exact boundary bytes, array/envelope, and cursor resume.
  • Add focused regression/contract tests, run the full net8.0 and net9.0 suite, and add the required bilingual changelog.d/unreleased/ fragment.

Acceptance criteria

  • Output never exceeds the promised budget except for a documented typed preflight envelope.
  • Truncated pages are valid JSON and resumable.
  • Full unbounded outline behavior remains unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codeenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions