A reply is accepted only as ONE complete JSON value: the whole text, or the
whole text wrapped in a single ```json fence. Nothing is extracted from
surrounding prose, and a truncated reply is never repaired into something
parseable: an incomplete answer must not become an executable one. Size,
nesting depth and node count are bounded before the caller validates the
shape, and prototype-polluting keys are refused outright.
Bounded parsing of a model's JSON reply.
A reply is accepted only as ONE complete JSON value: the whole text, or the whole text wrapped in a single ```json fence. Nothing is extracted from surrounding prose, and a truncated reply is never repaired into something parseable: an incomplete answer must not become an executable one. Size, nesting depth and node count are bounded before the caller validates the shape, and prototype-polluting keys are refused outright.