Repository navigation
Conversation
UX Review (Fable 5, fork) — ✅ PASSUX-level review of This PR adds no user-visible control, label, or copy — it is a pre-parse depth clamp that stops pathological markdown from crashing the transcript, channel, and notification views. Below the 100-level bound content renders byte-identically; past it (attacker-grade input only), content degrades gracefully to literal text instead of a UX-Verdict: PASS No user-visible surface changes: ordinary messages render byte-identically, and pathological input now degrades to visible text instead of crashing the whole view. [UX-REVIEWED] dda95c5 |
First Principles Review (Fable 5, fork) — 🟡 CONCERNSPremise-level review of All evidence gathered. The fix has checkable provenance (the added render tests execute the real parser and would overflow on base), no existing mechanism does this job, First-Principles-Verdict: CONCERNS "The single choke point" is one short: mochi's What this change shipsInventory (6 items) — 6 justifiedIntent: stop input-controlled markdown with pathological nesting from stack-overflowing the renderer and taking down channel/notification views — a FIX.
Watch
[FIRST-PRINCIPLES-REVIEWED] dda95c5 |
Design Review (Fable 5, fork) — 🟡 CONCERNSDesign-level review of All premises verified: Design-Verdict: CONCERNS Right fix shape at the right layer, but an 803-line hand-mirrored model of micromark + parse5 is now the sole availability defense on two boundary-less surfaces. Watch
Suggestions
[DESIGN-REVIEWED] dda95c5 |
Opus 4.8 Review (fork) — ✅ no blocking findingsReviewed Review detailsThe single candidate rests on an ordering seam:
The concern is real as a seam but cannot be grounded to a concrete input → observable crash. It dies under Step 1. No further grounded defect surfaced in the new module or its integration point. No findings. [OPUS-REVIEWED] dda95c5 |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 2 of 2 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- website/src/components/MarkdownRenderer.tsx:3968 -- Fence repair can expose nesting exempted by the clamp BLOCKING -- website/src/utils/clampNestingDepth.ts:641 -- HTML void rules undercount foreign-content nesting [BLOCK-MERGE] dda95c5 Adjudication (Opus 4.8) — is blocking on each finding proportionate?Both F1 and F2 are fenced findings — annotate-only, and I have no downgrade authority over them. My verdict set is UPHOLD-FENCED vs FLAG, and FLAG requires a complete evidence record showing the reaching conditions are so extreme a human would accept the residual risk. F1 — The diff adds F2 — |
0cf09c1 to
9f68e58
Compare
|
Human-writer override request for the source-position-drift flag (F2), per the adjudication result on this PR: The flagged drift (data-sourcepos coordinates vs unclamped content; |
9f68e58 to
2a03bd2
Compare
|
Maintainer re-run request: the CI and Build workflow runs on this PR failed inside the 17:19Z rate-limit window. The |
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]: This PR has been inactive for 7+ days with failing CI. I've assessed the blockers and they appear resolvable -- I'll push fixes directly to this branch as a co-author. Assessment: the reds are a GitHub API rate-limit flake and AI lanes that died before a verdict; plan is a rebase onto current main, a fresh CI run, and a decision on the mochi ChatPanel clamp the reviewers asked about. If you'd prefer I don't touch this PR, add the |
2a03bd2 to
f65e54e
Compare
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]: |
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
Chat markdown is input-controlled. Deeply nested constructs parse into a
tree whose depth equals the nesting count, and every recursive layer
downstream -- remark-rehype's mdast->hast transform, rehype-raw's
parse5->hast transform, and MarkdownRenderer's own eight self-recursive
walkers -- recurses to that depth. Past the engine's call-stack limit a
single message throws `RangeError: Maximum call stack size exceeded` and
takes down the whole transcript view.
The tree's depth is decided before any walker runs, at parse time, from the
raw text. So the guard is one input-side clamp at the choke point where a
message enters parsing, rather than a cap inside each of eight vendored
walkers plus the pipeline's own visitors: every downstream walker, present
and future, inherits the guarantee.
`website/src/utils/clampNestingDepth.ts` clamps three spellings of the same
class, each a way to reach a recursive layer:
1. CommonMark container prefixes in any interleaving the spec allows
(">>>>", "> > >" re-opens, "> - > -" quote/list mixes): scanned as
whole CONTAINER units (up to 3 spaces + quote or list marker,
sticky-iterated), not as consecutive ">" characters, and bounded per
line by MAX_BLOCKQUOTE_DEPTH.
2. Progressively indented list items, which no per-line marker count sees:
bounded by MAX_LIST_INDENT_COLS indent truncation. A marker at end of
line is an EMPTY item and nests like any other, so the indent clamp
accepts it exactly as the container scanner does; a run of empty items
otherwise kept its full indent and built the deep tree unbounded.
3. Raw HTML tag runs (<div><div>...): rehype-raw is wired into both rehype
pipelines, so embedded HTML parses into HAST the walkers recurse over
BEFORE sanitization. A conservative model of parse5's open-element stack
neutralizes opens past MAX_HTML_TAG_DEPTH by rewriting '<' to '<'
(literal in both micromark and parse5 contexts). Tag names are read by
the grammar of the context the line is in: micromark's inline-HTML shape
(letters, digits, '-') outside a block, where anything else makes the
whole '<...>' literal text; parse5's tokenizer rule inside an HTML block
(any byte until whitespace, '/' or '>'), where '<x:y>' is a real element
and reading it with the inline grammar would leave every such open
uncounted. "Whitespace" there
is the HTML tokenizer's set -- tab, LF, FF, CR, space -- wider than
CommonMark's, and it is the set used both to end the name and to accept
what follows it, or a tag ended by a form feed reads as literal text; NUL
is a name byte (the tokenizer substitutes U+FFFD and keeps going).
The HTML model errs over-count-only by construction: voids never push;
self-closing spelling on non-voids still opens (per parse5 -- honoring the
slash would under-count); same-name implied-end siblings replace the stack
top (<li> spam is flat); closes pop only on exact top match (bogus closers
cannot drain the counter).
A close tag can also be SPELLED where the tokenizer will not read one, and
every such place has to stop the pop -- otherwise the counter drains one per
open and a run of any length never clamps. Two are lexical: a quoted
attribute value and an inline code span. The code-span mask pairs backtick
runs by EXACT length across the lines of a paragraph, as CommonMark does,
and resets at a paragraph break; a run of any other length inside the span
is literal and leaves the mask on. The mask is over-count-only: it may
suppress a pop, never a rewrite -- an open past the bound is neutralized
whether or not the mask is on, because the mask is a guess that a span is
open and an unpaired backtick run is literal text, so honoring the guess at
the bound would let one stray backtick switch the guard off for the rest of
the paragraph. The rest are spans parse5 makes a single node of, so their
whole body is skipped, latched across lines when the end is not on the
opening one:
- `<!--` is a comment, ending at '-->' or at '--!>', and abruptly on the
empty spellings '<!-->' and '<!--->'.
- `<?`, any other `<!`, and `</` followed by a non-name are BOGUS COMMENTS,
each ending at the first '>'. `<![CDATA[` is one of them: the CDATA
tokenizer state is reachable only inside foreign (SVG/MathML) content,
which this model does not enter, so ending that span at ']]>' would run it
PAST the '>' where parse5 ends it.
Ending a span late is the dangerous direction -- it skips tags the parser
does nest, which under-counts and leaves the run unclamped -- so each end
condition is taken from the tokenizer and the search starts two characters
into the opener, which is what makes the abrupt empty-comment spellings end
where the tokenizer ends them. A '<!' inside a code span is literal text
that opens no node, so no latch is taken there: latching would skip the real
tags after the span. And because a latched span's end line can carry no '<'
at all (a bare '-->'), the two fast-path guards that skip a line with no tag
character also run the scan while a latch is open; skipping such a line would
leave the latch set and hide the next line's real tags.
Exemption windows are judged by the downstream parser's semantics, in both
directions. A fenced code block is exempt (marker runs inside a fence are
literal text), and "is this line a fence?" follows micromark's CommonMark
semantics: a backtick fence's info string may not contain a backtick, so
such a line is a paragraph to the parser and opens no exemption window
here. A line opening an HTML BLOCK swallows following lines as raw content
until the block's end condition, so while that latch is open fence-OPEN
recognition is suppressed and container clamps do not apply, while the tag
pass keeps running -- raw block content is exactly what parse5 nests. The
raw-block end condition is a disjunction over all four raw closers, matching
micromark's own continuationRawEndTag, which accepts '</script>' as the end
of a '<pre>' block. Where fence detection is unsure it fails closed (stays
clampable): the worst case is cosmetic clamping of fenced marker art, never
an unclamped deep run reaching the parser.
Clamping stays minimal-mutation: below every bound content is
byte-identical, and a clamped line drifts by one inserted escape byte
(containers) or 3 bytes per neutralized tag (HTML). The API is deliberately
minimal -- `clampNestingDepth(s)` with the bounds as module constants -- so
there are no tunables the single production call site does not use.
The call site is `MarkdownRenderer.tsx` (`MarkdownBlock`), immediately after
the existing stray-tag strip and before any parsing. It runs in both
sourcePos modes: a message that crashes the renderer has no coordinates
worth preserving.
Tests: `MarkdownRenderer.depthGuard.test.tsx`, 44 cases. The overflow
vectors, the pseudo-fence vector and every fake-close spelling fail without
the fix, each independently: reverting the span skip turns the comment and
the PI/declaration cases red with the exact `RangeError`, and reverting
the '--!>' alternative, the malformed-close span, the exact-length span
pairing, the mask-independent neutralization, the raw-context tag-name rule,
the tokenizer whitespace set or the empty-item marker leaves its own vector
completely unclamped. The nested-list fixture is pinned at 600
levels: it is quadratic in depth (~2.3MB at 1,500) and parses well inside
the per-test budget at 600, which still convicts 4.7x past the effective
bound.
The module is listed as a named boundary in website/eslint.i18n.config.js,
alongside unifiedPatchHeaders.ts: every string in it is a grammar token
handed to a parser, never copy, and the raw-block closers are derived from
the names table so the two cannot drift apart.
Co-authored-by: Kiro Crew <noreply@kirodotdev.github.io>
ad183c9 to
dda95c5
Compare
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
Reproduced before fixing at ad183c9:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
Reproduced at dda95c5:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
Reproduced at dda95c5:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]:
|
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]: Maintainer decision needed — head This PR was driven under a two-code-round cap after its first re-review (a hardening guard invites an unbounded stream of new bypass spellings). Both rounds were spent on reproduced crashes, and every CI gate except the GPT lane is green on the current head. The GPT lane's final round found two more, both reproduced ( What this head fixes vs. What remains (#10620): (1) Options:
Design / First Principles CONCERNS on this head are all dispositioned (records above); UX and Opus are clean. |
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]: Closing this PR in favor of a different approach. @javenciu — thank you for this work: the problem statement is exactly right, the reproducers are real, and four review rounds here are what made the structural issue below visible. The replacement PR will credit you as co-author. Why the input-side clamp cannot convergeThe clamp rewrites the raw string before parsing, so it has to predict what two parsers (micromark, then parse5 via
What the verification showedMeasured against the pinned versions in
The replacement designBound depth on the real parser's output, so there is nothing to predict:
Prototype results at the same bounds, ~60 lines total, no grammar modeling: every vector this PR's tests pin plus both #10620 residuals render without throwing; ordinary content is byte-identical through the bounded pipeline. Out of scope for either PR and tracked separately: micromark's own quadratic cost on multi-megabyte deeply indented lists (~97s for a 1,500-level 2 MB message) is a size problem, not a depth problem, and wants an input-size cap; the two bare Follow-up PR link will be added here once it is open. Issues #10571, #10607 and #10620 will be updated to point at it. |
|
🤖 Kiro Crew [operator: iamwhatever#241cc860]: Follow-up PR is open: #10753 — "bound markdown nesting depth on the parsed tree, not the text". It bounds depth on the parsed mdast (via a |
Problem / Motivation
A chat message containing pathologically nested markdown — for example thousands of leading
>blockquote markers, or equivalently deep nested list indentation, or a long<div><div>…raw-HTML run — parses into an mdast/hast tree whose depth equals the nesting count.MarkdownRenderer.tsxwalks that tree with plain recursive functions (eight self-recursivewalkhelpers), and remark-rehype's own mdast→hast transform recurses too, as doesrehype-raw's parse5→hast transform. Past the engine's call-stack limit this throwsRangeError: Maximum call stack size exceededwhile rendering a single message.Reproduced at
origin/main: a message of 50,000 nested blockquote markers crashes<Markdown>withRangeError(React error-boundary trace pointing into the render), and the affected vitest run hangs to timeout. Where that error lands is surface-dependent — see Why it matters.Why it matters
The blast radius depends on the surface, and the honest statement is two-part. In the chat transcript, every message is wrapped in
MessageErrorBoundary(src/pages/chat/AssistantMessage.tsx,src/pages/chat/ChatPageMessageContent.tsx,src/app-sdk/messageRenderers.tsx), so the pre-fix cost there is one message degraded to the boundary's raw-text fallback — plus a multi-second overflow parse repeated on every streaming frame while that message is the live tail. Outside chat,MarkdownRendereris rendered bare:src/pages/ChannelPage.tsx(channel message bodies) andsrc/components/notifications/NotificationDetailPanel.tsx(notification bodies) have no per-item boundary, so the sameRangeErrorpropagates to the app-levelErrorBoundaryinApp.tsxand replaces the whole view. Both are input-controlled: a channel message or a notification body arrives from outside, and nothing upstream caps nesting depth, so the renderer is the layer that has to defend itself.What changed (motivation → approach → change)
The tree's depth is decided before any walker runs — at parse time, from the raw markdown text. Two fix shapes were considered: per-walker depth caps (eight vendored walkers plus the remark/rehype pipeline's own visitors, each needing its own cap and each a future maintenance hazard) versus one input-side clamp at the choke point where a message enters parsing. The input clamp wins structurally: every downstream walker — present and future — inherits the guarantee.
New
website/src/utils/clampNestingDepth.tsbounds three spellings of the same class, each a distinct way to reach a recursive layer:>>>>,> > >re-opens through the 0–3 space indent,> - > -quote/list mixes). Scanned as whole CONTAINER units (up to 3 spaces + a quote or list marker, sticky-iterated), not as consecutive>characters, and bounded per line byMAX_BLOCKQUOTE_DEPTH(100).MAX_LIST_INDENT_COLS(256) indent truncation. A marker at end of line is an empty item and nests like any other, so the indent clamp accepts it exactly as the container scanner does — a run of empty items otherwise kept its full indent and built the deep tree unbounded.<div><div>…).rehype-rawis wired into both rehype pipelines, so embedded HTML parses (parse5) into HAST that the recursive walkers consume before sanitization — the same stack-overflow class through an alternate grammar. A conservative model of parse5's open-element stack neutralizes opening tags pastMAX_HTML_TAG_DEPTH(100) by rewriting<to<(literal in both micromark and parse5 contexts). Tag names are read by the grammar of the context the line is in: micromark's inline-HTML shape (letters, digits,-) outside a block, where anything else makes the whole<…>literal text; parse5's tokenizer rule inside an HTML block (any byte until whitespace,/or>), where<x:y>is a real element and reading it with the inline grammar would leave every such open uncounted. "Whitespace" there is the HTML tokenizer's set — tab, LF, FF, CR, space — wider than CommonMark's, and it is the set used both to end the name and to accept what follows it, or a tag ended by a form feed reads as literal text; NUL is a name byte (the tokenizer substitutes U+FFFD and keeps going).The HTML model errs over-count-only by construction: voids never push; self-closing spelling on non-voids still opens (per parse5 — honoring the slash would under-count); same-name implied-end siblings replace the stack top (
<li>spam is flat); closes pop only on exact top match (bogus closers cannot drain the counter).A close tag can also be spelled where the tokenizer will not read one, and every such place has to stop the pop — otherwise the counter drains one per open and a run of any length never clamps. Two are lexical: a quoted attribute value and an inline code span. The code-span mask pairs backtick runs by exact length across the lines of a paragraph, as CommonMark does, and resets at a paragraph break; a run of any other length inside the span is literal and leaves the mask on. And the mask is over-count-only: it may suppress a pop, never a rewrite. An open past the bound is neutralized whether or not the mask is on, because the mask is a guess that a span is open and an unpaired backtick run is literal text to micromark — honoring the guess at the bound would let one stray backtick switch the guard off for the rest of the paragraph. The cost of guessing wrong the other way is cosmetic:
<div>shown inside a code span that already sits past a hundred open tags. The rest are spans parse5 makes a single node of, so their whole body is skipped, latched across lines when the end is not on the opening line:<!--is a comment, ending at-->or at--!>, and abruptly on the empty spellings<!-->and<!--->.<?, any other<!, and</followed by a non-name are bogus comments, each ending at the first>.<![CDATA[is one of those: the CDATA tokenizer state is reachable only inside foreign (SVG/MathML) content, which this model does not enter, so ending that span at]]>would run it past the>where parse5 ends it.Ending a span late is the dangerous direction — it skips tags the parser does nest, which under-counts and leaves the run unclamped — so each end condition is taken from the tokenizer, and the search starts two characters into the opener, which is what makes the abrupt empty-comment spellings end where the tokenizer ends them. A
<!inside an inline code span is literal text that opens no node, so no latch is taken there: latching would skip the real tags after the span. And because a latched span's end line can carry no<at all (a bare-->), the two fast-path guards that skip a line with no tag character also run the scan while a latch is open — skipping such a line would leave the latch set and hide the next line's real tags.Exemption windows are judged by the downstream parser's semantics, in both directions. A fenced code block is exempt (marker runs inside a fence are literal text), and the standard for "is this line a fence?" is micromark's CommonMark semantics: a backtick fence's info string may not contain a backtick, so such a line is a paragraph to the parser and opens no exemption window here. Conversely, a line opening an HTML block (CommonMark 4.6: type-6 known block names, condition-7 complete tags alone on a line,
<pre>/<script>/<style>/<textarea>, comments, PIs, declarations, CDATA) swallows every following line as raw block content until the block's end condition — a```-shaped line there is not a fence to micromark, so entering fence state on it would exempt an unclamped deep run behind a 3-token shield prefix. While that latch is open, fence-OPEN recognition is suppressed (backtick and tilde alike), container clamps do not apply, the inline code-span mask is inert, and the HTML tag pass keeps applying — raw block content is exactly what parse5 nests. Block-name tables are copied from micromark's ownmicromark-util-html-tag-namelists, and the raw-block end condition is a disjunction over all four raw closers, matching micromark'scontinuationRawEndTag, which accepts</script>as the end of a<pre>block. Where fence detection is unsure it fails closed (stays clampable), and the approximations over-latch only: the worst case is cosmetic clamping of fenced marker art, never an unclamped deep run reaching the parser.Clamping stays minimal-mutation: below every bound content is byte-identical, and a clamped line drifts by one inserted escape byte (containers) or 3 bytes per neutralized tag (HTML). The API is deliberately minimal —
clampNestingDepth(s)with the bounds as module constants — since the production call site uses the defaults and unused tunables are a maintenance liability.Lint boundary.
website/eslint.i18n.config.jslists the module as a named boundary, the same idiom asunifiedPatchHeaders.ts: every string in it is a grammar token handed to a parser (</pre>-class raw-block closers, the<a neutralized tag becomes, tag names from micromark's tables), never user-visible copy, and the raw-block closers are derived from the names table so the two cannot drift. Verified copy-free: the module imports neitheri18nTnoruseTranslation.The call site is
MarkdownRenderer.tsx(MarkdownBlock):clean = clampNestingDepth(clean)immediately after the existing stray-tag strip, before any parsing. It runs in both sourcePos modes — a message that crashes the renderer has no coordinates worth preserving.Tests
website/src/test/MarkdownRenderer.depthGuard.test.tsx(44 tests; the overflow vectors, the pseudo-fence vector and every fake-close spelling fail without the fix):```x`yis a paragraph per CommonMark; treating it as a fence would exempt a following deep run from clamping — pinned failing-without-fix with the exactRangeError)</ … >); a comment spanning lines keeps swallowing closes until its end; an ordinary below-bound comment stays byte-identical<x:y>) counts toward depth and is neutralized past the bound, as does a tag ended by form feed or CR or holding NUL; outside one<x:y>is literal text and stays byte-identical>rather than]]>(both with and without a>of its own before the run), a comment also ends at--!>, and<!-->/<!--->end abruptlyRevert-verified per guard, not just in aggregate: removing the span skip turns the comment and PI/declaration cases red with
RangeError: Maximum call stack size exceeded; removing the--!>alternative, the malformed-close span, the exact-length pairing, the mask-independent neutralization, the raw-context tag-name rule, the tokenizer whitespace set, or the empty-item marker each leaves its own vector entirely unclamped while the other 43 stay green.The nested-list fixture is pinned at 600 levels rather than 1,500: it is quadratic in depth (~2.3MB at 1,500), which parses in ~3s locally but 28s on CI against the 15s per-test budget — a fixture-cost timeout, not a clamp miss. 600 levels still convicts 4.7× past the ~128 effective-level bound.
Manual verification
Rendered a 50,000-deep blockquote message through the fixed
MarkdownBlockin the vitest DOM harness: renders as a clamped-depth blockquote chain instead of crashing. A 50-deep message renders exactly as before (passthrough verified byte-identical at the clamp layer).Related Issues
None fixed by this PR. Deferred follow-up: #10571 (the mochi
ChatPanelsurface runs its own copy of this pipeline and needs the same clamp; see Pattern harvest). Re-checked against the current open queue (428 PRs): 11 rows touchMarkdownRenderer.tsxor the mochi panel, none of them on this seam.Pattern harvest
The pattern is recursive tree processing whose recursion depth is input-controlled with no guard at any layer. Harvested across this seam: eight self-recursive walkers inside
MarkdownRenderer.tsxplus the remark/rehype pipeline's own recursive visitors all share the same exposure, and all funnel through one input choke point (MarkdownBlock's pre-parse string). Fixing at the choke point covers every current walker and any walker added later, where per-walker caps would rot.Four further harvests, each from review:
rehype-rawmakes embedded HTML a parse path, so<div>runs were the same attack through a different grammar, and the guard was incomplete until all three spellings (container prefixes, list indent, HTML tags) hit a bound at the same choke point.<![CDATA[is the trap: it looks like it ends at]]>, and does in foreign content, but in HTML content it is a bogus comment ending at the first>. Every end condition here is now pinned by a test asserting the clamp's own output, because a late end produces no error — just an unguarded run.And one harvest about scope rather than mechanism: a guard placed at "the" choke point is only as complete as the count of choke points. The mochi
ChatPanelsurface runs its own copy of this pipeline over the same untrusted content and stays crashable; it is tracked in #10571 rather than fixed here, because that file has five<Markdown>call sites and no single pre-parse point — clamping its two function inputs upstream would rewrite<mcwidget>HTML beforeparseWidgetsextracts it (measured: a 150-deep widget body loses 51 opening tags), so a correct fix is per-segment clamping at all five sites, which is a different change from this one.Rule candidate: when recursion depth is controlled by input, clamp the input at every entry choke point instead of capping each recursive consumer — and enumerate four things, because covering one of each leaves the guard bypassable through the next: the grammars the pipeline parses into depth, the surfaces that run that pipeline, the constructs in which a decrement can be spelled without being real, and the exact end condition of each construct you skip.
F2 (source-position drift) — human-writer override rationale
The flagged drift (data-sourcepos coordinates vs unclamped content; first-duplicate fallback may miscite a selection location) can occur only on lines the clamp rewrote — input carrying more than 100 leading container markers on a single line, which does not occur in human-authored content. For that adversarial class the alternative to approximate citation is no render at all (the stack overflow this guard exists to stop). The rewrite keeps the kept prefix byte-identical and inserts exactly one byte, so coordinates are exact for all unclamped lines and for everything before the clamp point on a clamped line. Adjudication: total=0 uphold=0 (flag not upheld); requesting human-writer override on that basis.
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Per the template placeholder (CLA text pending): offered under the same terms as my prior merged contributions to this repository (#8835).
Why no screenshot: no visual delta -- this change rewrites pathological input strings (>100
leading container markers per line, >256 indent columns, or >100-deep raw
HTML tag runs per message) before parsing; ordinary content is byte-identical
through the clamp and renders unchanged. UX review confirmed zero visual
delta.