StreamingContextScrubber #714

Closed
opened 2026-10-27 13:37:27 +00:00 by sam · 0 comments
Owner

Implement a stateful StreamingContextScrubber that strips ... fence spans from streaming text output. Must handle partial chunks that split across fence boundaries, maintain state between chunks, and only emit clean text downstream.

Acceptance Criteria

Scrubber is in internal/memory/scrubber package
Implements an io.Writer or callback interface for processing streaming chunks
Strips ... fences including the tags themselves
Handles partial chunks where fence tags span chunk boundaries (maintains state)
Handles missing closing tags (closes at end of stream)
Doesn't interfere with non-memory-context content
Zero allocations in the hot path (reuses buffers)
Fully tested with edge cases: partial open/close, nested tags, empty content


Imported from beads archie-core-1786637494756-189-de46559c · GitHub #210 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08

Implement a stateful StreamingContextScrubber that strips <memory-context>...</memory-context> fence spans from streaming text output. Must handle partial chunks that split across fence boundaries, maintain state between chunks, and only emit clean text downstream. ### Acceptance Criteria Scrubber is in internal/memory/scrubber package Implements an io.Writer or callback interface for processing streaming chunks Strips <memory-context> ... </memory-context> fences including the tags themselves Handles partial chunks where fence tags span chunk boundaries (maintains state) Handles missing closing tags (closes at end of stream) Doesn't interfere with non-memory-context content Zero allocations in the hot path (reuses buffers) Fully tested with edge cases: partial open/close, nested tags, empty content --- _Imported from beads `archie-core-1786637494756-189-de46559c` · GitHub #210 · type task · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumtask labels 2026-10-27 13:37:27 +00:00
sam self-assigned this 2026-10-27 13:37:27 +00:00
sam closed this issue 2026-10-27 13:37:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#714