Skip to content

Bound public parsing resource use and add scale regressions #14

Description

@coderabbitai

Summary

Bound public parsing resource use and add regression coverage for large input, deep conditional nesting, and output growth.

Rationale

The CLI limits source reads to 16 MiB, but public parse_source accepts unbounded byte slices. Nested facts clone full condition ancestry. The repository has no realistic 10 MiB regression or output-growth measurement to prevent resource regressions.

Affected areas

  • src/application.rs
  • src/domain/
  • src/adapters/source.rs
  • src/adapters/makefile.rs
  • Parser and integration test modules
  • Resource-limit documentation

Required changes

  • Enforce a source-size bound at the public parsing boundary, or define and enforce equivalent bounds for condition ancestry and report/output growth.
  • Keep CLI and library behaviour consistent for bounded input.
  • Reduce or cap repeated condition-ancestry allocation where required by the selected limit.
  • Add a realistic approximately 10 MiB input regression.
  • Add a deep-nesting regression.
  • Define measurable time and memory limits, or use deterministic bounded-output assertions that detect unbounded growth.
  • Document public resource limits and failure behaviour.

Acceptance criteria

  • parse_source cannot process unbounded input without an explicit documented resource contract.
  • Large input at the supported limit has regression coverage.
  • Deep conditional nesting has regression coverage.
  • Tests detect excessive output or ancestry growth.
  • Tests specify and enforce measurable resource limits or deterministic bounded-growth limits.
  • CLI diagnostics and existing source-size error behaviour remain stable.
  • Documentation states the public parsing and output resource limits.

Backlinks

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions