Skip to content

Ticket: Share the Command execution owner with captured output #466

Closed

Description

@JacobStephens2

Parent

#465

What to build

Make one Command execution module own CLI lifetimes for both captured output and streaming. Route existing Harness execution through it without changing session behavior, and verify captured execution at the same owning interface. This is the green prefactoring that gives the following Tickets a tested execution owner to call.

The settled interface has two synchronous operations. Both accept a prepared command, optional stdin, diagnostic name, explicit interruption policy and the real stop action; streaming also accepts its consumer and retained state. Harness preparation and stop behavior remain in the Harness adapter. Do not introduce a public start/poll/wait handle or couple the shared owner to Harness types.

Acceptance criteria

  • Harness execution uses the shared owner, and its existing environment preparation, stop actions, streamed output and recovery behavior remain intact.
  • Captured execution returns uninterpreted exit status and stdout/stderr bytes, drains both streams concurrently, and writes optional stdin once before closing it. It performs no Git or GitHub parsing.
  • Ordinary execution observes recorded interruption before spawn, during supervision and before return; after stopping, reaping and joining its execution, interruption takes precedence over exit status or transport failure. Completion execution ignores interruption for its own lifetime without clearing the flag or changing ordinary execution.
  • Ownership starts immediately after spawn. Partial setup failure, writer/reader failure, consumer failure, worker panic and unwind cannot return while the direct child or a started worker remains owned and unfinished. EOF alone does not finish execution.
  • Reuse the existing process-tree supervision and owned process groups. Captured Git/GitHub stop behavior can use SIGTERM, the existing ten-second grace and then SIGKILL; Harness retains its existing actions and signals. The owner's process snapshot stays a direct capture to avoid recursion.
  • Successful normal completion continues to leave background work with none of the execution's I/O alone. Preserve the current discovery guarantee for known descendants rather than adding continuous tracking or promising discovery after ancestry is lost.
  • Worker completion, including unwind, wakes supervision internally. Interrupt checks wait at most 100 ms; short captures do not incur a mandatory 100 ms polling sleep. Check representative short captures locally without introducing a timing-sensitive CI benchmark.
  • Move the existing ownership tests to the shared interface and retain Harness-specific tests at its adapter. A normally returned streaming consumer retains its state after ordinary transport failure; startup failure or consumer panic yields none, and interruption suppresses recovery and retained reads.
  • Isolated subprocess fixtures verify all three recorded signals, refusal before spawn, active ordinary cancellation, completion with an existing or newly arriving interrupt, independent ordinary/completion policy, concurrent byte streams, nonzero status, startup/worker faults, and a CLI that exits while its owned group still holds an output pipe. Clean up fixtures by their recorded IDs.
  • Existing Harness process and process-tree checks pass. Git and GitHub production call sites keep their current behavior until the following Tickets migrate them; this prefactoring lands green on its own.

Blocked by

None (can start immediately).

Activity

  1. added
    ready-for-agent
    on Oct 7, 2026
  2. JacobStephens2 commented on Oct 7, 2026

    @JacobStephens2
    OwnerAuthor

    Closed by #469, merged into issue-465 by a thirdshift Merge run.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions