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
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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