Parse ceilings for the bounded JSON decoder — resource-exhaustion guards, distinct from the eight operational ceilings an artifact declares.
Every field is a positive integer. maximum/0 is the immutable profile
ceiling. new/1 derives a tighter profile: an override may only lower a
field, never raise it, so a portable input can never widen a host's parse
limits.
| field | meaning |
|---|---|
bytes | maximum total input size |
depth | maximum structural nesting |
members | maximum members in one object |
items | maximum items in one array |
nodes | maximum total value nodes |
string | maximum byte length of one string value |
key | maximum byte length of one object key |
number_lexeme | maximum byte length of one number's source lexeme |
Parse ceilings are decoder limits — the profile authorizes nothing.
Summary
Functions
Validate and normalize a Bounds struct, or build one from an overrides map.
The immutable profile maxima.
A tighter profile from overrides. Each override key must be known and its
value a positive integer no greater than the corresponding maximum
(tighten-only). Omitted fields keep their maximum.
Types
@type error() :: :unknown_bound | {:ceiling, atom()}
@type t() :: %AgentBlueprintProtocol.Bounds{ bytes: pos_integer(), depth: pos_integer(), items: pos_integer(), key: pos_integer(), members: pos_integer(), nodes: pos_integer(), number_lexeme: pos_integer(), string: pos_integer() }
Functions
Validate and normalize a Bounds struct, or build one from an overrides map.
A struct is re-validated field-by-field, not trusted: a directly-constructed
%Bounds{} carrying a super-maximum (or non-positive) ceiling is rejected, so
the tighten-only invariant holds no matter how the struct was made.
@spec maximum() :: t()
The immutable profile maxima.
A tighter profile from overrides. Each override key must be known and its
value a positive integer no greater than the corresponding maximum
(tighten-only). Omitted fields keep their maximum.