Converts a stream of mdz opcodes to the MdzNode[] tree representation.
Stack-based replay over a single flat children buffer: leaves push to the
shared buffer, and each open frame records where its children begin
(children_start). close slices the frame's range out into the built
node; revert dissolves the frame boundary in place — its accumulated
children become the parent's without copying — and merges the replacement
delimiter text into an adjacent text node. Adjacent text left behind by
reverts is coalesced once per container by mdz_merge_adjacent_text at
close, so cascading reverts of deeply nested unclosed containers cost O(n)
total instead of re-parenting (O(n²)) at every level.
The output is identical to mdz_parse() from mdz.ts, enabling
validation of the streaming parser against the existing fixture suite.