Skip to content

SW-208 — Apply bounded backpressure when forwarding long-running child output #390

Open

Description

@dDevAhmed

Summary

The supervisor forwards every child output chunk directly to TerminalOutput and ignores the destination stream's write/backpressure result. A noisy child can outpace a redirected or slow output stream and accumulate an unbounded writable queue. Define a bounded forwarding policy that pauses/resumes child streams or otherwise limits queued output.

Workstream

  • Workstream: WS-PERFORMANCE
  • Primary scope: src/dev/orchestrator.ts; src/output/terminal.ts; tests/dev-orchestrator-startup-and-buffering.test.ts
  • Protected surface: Yes — maintainer review required
  • Priority: P1
  • Difficulty: high
  • Proposed points: 200

Acceptance Criteria

  • The output adapter exposes a testable backpressure signal.
  • Child streams pause when the destination cannot accept more data and resume on drain.
  • Buffering has an explicit upper bound and deterministic overflow behavior.
  • stdout and stderr remain ordered independently.
  • Redaction and line buffering remain applied before output is written.

Dependencies

None unless noted above.

Out of Scope

  • Unrelated architecture or public command-contract changes.
  • New runtime dependencies without maintainer approval.
  • Mainnet deployment or remote template execution.

Definition of Done

  • Acceptance criteria have deterministic regression coverage.
  • Security and compatibility boundaries remain intact.
  • Supported-platform CI passes.

Labels

  • Stellar Wave (do not apply until activation is explicitly authorized)
  • type: performance
  • area: performance
  • priority: P1
  • difficulty: high
  • points: 200
  • workstream: performance

Sequencing and scope note

Sequencing: implement after SW-207 (#389) so stream error and shutdown semantics are stable before adding backpressure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions