githubnext/chopinPublic

Let's compose rich plans together

Keep large bracket-heavy pastes from stalling the server

A pasted run of `]` made the server's validation re-parse quadratic in
micromark, and the canonical serializer was quadratic in the number of
escaped characters. A 128 KB paste of "[a]" held the event loop for over
five minutes, so the storage writer lease expired and the server shut
down. Escape every closing bracket in prose and patch the serializer's
escape bookkeeping so both stay linear.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
C5MAMaggie Appleton and Claude Opus 5.5 authored
9800ccfPatch
Parent6caaa51
6 files changed+108-2
StackedSplit
apps/server/src/plan/room.test.ts+36 −0
bun.lock+1 −0
package.json+2 −1
packages/dialect/src/dialect.test.ts+36 −0
packages/dialect/src/serialize.ts+20 −1
patches/mdast-util-to-markdown@2.1.2.patch+13 −0