Skip to content

Bound intermediate text while rendering compact schema composites #558

Closed

Description

@zackbart

Motivation

An audit at 6ed3894 found that compact schema output is byte-bounded, but composite rendering accumulates child strings before checking the combined result. Individually valid property descriptions can therefore produce megabytes of temporary text that will be discarded against the 8 KiB describe limit. A synthetic 1,000-property schema with 4,000-character descriptions exhibited roughly 5.5 MB of transient heap growth in a local Node probe. This is illustrative allocation evidence, not a stable performance benchmark.

Behavioral requirements

  • Composite schema rendering stops consuming later members once its output byte budget cannot be satisfied.
  • Within-budget schemas retain their existing rendered output, ordering, constraints, and reference behavior.
  • Oversized schemas retain the existing explicit truncation behavior.
  • Count UTF-8 bytes, including composite punctuation and property comments.
  • Preserve shared work limits and Node/Workers portability.

Acceptance criteria

  • Regression coverage proves rendering stops before visiting later members of an oversized composite, rather than merely bounding the final response.
  • Cover wide objects and composite forms, including multibyte text and valid near-boundary output.
  • Compare the motivating synthetic case before and after, with measurement limitations stated.
  • npm run check passes.

Related prior discovery bounds: #82. Reference investigation: UsefulSoftwareCo/executor#1977. This issue concerns intermediate rendering cost, not OpenAPI ingestion or a new compiler.

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