Skip to content

Agent surface lane: bounded stream collector module #582

Description

@omridevk

Parent

#579

What to build

A standalone collector that turns an event-iterator subscription into a bounded batch for one-shot agent executions: caller-suggested limit/timeout inside hard server ceilings (events, bytes checked per event before accumulation, duration, concurrency), guaranteed unsubscribe via abort + finally, invalid bounds rejected with a declared error. Pure module with its own tests; wired into the gate-core lane later.

Spec: docs/superpowers/specs/2026-08-22-agent-api-surface-design.md (Streams: bounded collectors). Plan task 9.

Acceptance criteria

  • Limit, timeout, byte and event ceilings enforced; first ceiling hit returns what was gathered
  • Cleanup proven: iterator finally observed on abort, timeout, and limit paths
  • Concurrent-collector cap per execution
  • Zero/negative/NaN/over-ceiling bounds throw the declared error
  • Two ambient sessions collecting concurrently receive only their own events

Blocked by

None — can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentTicket is fully specified and agent-grabbable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions