Skip to content

Commit 51878ba

Browse files
committed
devlog(260828): wp2 audit round-2 fold — combined-length coalescing threshold
1 parent cfb27c8 commit 51878ba

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎devlog/_plan/260828_cursor_ndjson_backlog_train/010_backlog_abort_fix.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ tail exists:
1616
Never mutate pushed objects: push() has no ownership/copy contract
1717
(run-turn-queue.ts:7-11) and adapters may retain/re-emit event objects —
1818
interface-level alias safety, so replacement only (A-gate blocker 6).
19-
- Byte bound (A-gate blocker 5): merge only while tail.text.length <= 64KB;
20-
past that, append as a new item so a single merged item cannot grow
21-
unbounded and re-copy on every push. The backlog cap then bounds total
22-
memory at ~64KB * 1024.
19+
- Coalescing threshold (A-gate round-2 blocker 1): merge only while
20+
tail.text.length + event.text.length <= 64 * 1024 (UTF-16 code units —
21+
a coalescing threshold, NOT a byte-memory cap; a single oversized
22+
incoming event stays a single item, and byte-based caps remain out of
23+
scope). Past the threshold, append as a new item. Same combined-length
24+
rule for thinking merges.
2325
- tail.type === "thinking_delta" && event.type === "thinking_delta" ->
2426
merge thinking strings likewise (same replacement + byte-bound rules).
2527
- event.type === "heartbeat" && tail.type === "heartbeat" -> drop event

0 commit comments

Comments
 (0)