Skip to content

Add bounded JSON output to unused analysis #4905

Description

@Widthdom

Summary

unused has cursor/summary modes but no --max-json-bytes; --by-bucket can emit thousands of rows, and the current Markdown suppression population alone is 1,683.

Audit IDs: R-07. Reproduced with locally built cdidx v1.40.3 at 404db09489c305f17d94f37026e00564d3ac527a.

Existing issue relationship

Residual/follow-up to closed #4344; closed #4585 is adjacent bounded-output work.

Expected behavior and PR scope

Apply the common whole-row byte budget to normal and by-bucket unused JSON while preserving continuation/completion metadata. Response-shape duplication is tracked separately.

Implementation guide for Codex 5.6 sol xhigh

  • Measure final UTF-8 bytes and emit only complete rows/envelopes.
  • Bind cursor to filters/buckets/order/index generation and expose returned/omitted/has_more.
  • Return a typed minimum-budget error when required envelope/first row cannot fit.
  • Cover compact/full/by-bucket, huge signatures, Unicode, exact boundaries, final/empty pages, and stale cursors.
  • Add focused positive/negative regression tests, run the full net8.0 and net9.0 suite, and add the required bilingual changelog.d/unreleased/ fragment.

Acceptance criteria

  • Unused JSON respects the requested budget.
  • Every partial response remains valid and resumable.
  • Unbounded behavior and selection semantics remain 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