Repository navigation
Description
What
Two leftovers of the work bound on the answer-envelope slicer (readAnswerEnvelopes, src/shared/engine/arrival.ts), both found by a review of the cap and read by the wave coordinator in the code.
-
The cap leaves a whole message unread. A text that would cost more than
MAX_ENVELOPE_CHECKS(64) whole-slice checks is left whole: no envelope is read from it. A message that joins several envelopes written by builds before the envelope stopped carrying the model's question text can reach the cap when those questions hold many lines that end in a code fence, because each such line costs one check. After a reload the requests those envelopes answered then draw as unanswered. No grant and no save decision depends on this reading (the grant reader does not use the slicer), so the cost is the drawing only, and only for old stored messages. -
PASTED_BLOCKis super-linear on unclosed opening tags. The pattern insrc/shared/composer/pasted-content.tspairs an opening tag with its closing tag through a lazy run and a back-reference; a text with many opening tags and no closing tag makes each opener scan to the text's end. The slicer no longer uses the pattern from the "Approve and retry" landing on (it uses the linearpastedBodiesscan there). The other readers still use it on a user message's text: the transcript'ssplitPastedSegments(src/renderer/src/transcript/model/user-text.ts), the session index's title text (src/services/index/sessions.ts), the first message's text (src/renderer/src/sessions/first-message.ts) and the queue's entry text (src/renderer/src/composer/queue/entry-text.ts).
Direction
- One linear reader of pasted segments (the
pastedBodiesscan, moved to the shared composer module) used by every reader above, with a work pin that would fail on the quadratic form and a differential test againstPASTED_BLOCKon writer-made texts. - A slicer that finds an envelope's end in one forward pass (the strict line grammar of
src/shared/maws/ask-strict.tsalready does this for the current form), so the cap is no longer the only bound and old joined envelopes are read at any size.
Acceptance
- A text of N opening paste tags with no closer costs work linear in its length in each reader named above (a counted pin).
- A message joining old-form envelopes whose questions hold more than 64 fence lines reads every envelope, and its requests draw as answered after a reload.
- Readings of writer-made messages are unchanged (the seeded corpus).
Activity
SSFSKIM commentedon Nov 20, 2026
[board] in-progress: batch 7, group D
The envelope slicer spends a check on a result block, and one linear …
Review of batch 7 group D: pastedBodies agrees with pastedSegments on…
Review of batch 7 group D: pastedBodies agrees with pastedSegments on…
SSFSKIM commentedon Nov 20, 2026
[board] in-review: batch 7, PR #804