Skip to content

The command provider's actions return (string, error): stdout as the result, a non-zero exit as an error carrying its code #1153

Open

Description

@David-Noble-at-work

Problem

Ruled 2026-10-23: "Anything written to stdout is accumulated and returned in a struct that includes the output to stdout and an exit code… Non-zero exit codes ⇒ error. There is no compensating action." The shell provider returns Result{Command, ExitCode, Stdout, Stderr}: Stderr duplicates what is now narration, Command is the caller's own input, and a zero exit code says nothing. #824 asks the opposite of the ruling, a non-zero exit returned rather than raised.

Solution

The command provider's actions are fallible, not compensable: (string, error), Go's own exec.Cmd.Output shape. The string is everything the child wrote to stdout; the error, on a non-zero exit, carries the exit code and the argv, as *exec.ExitError does, and no stderr, which the user has already seen. No accepted-exit-codes parameter until a use appears (grep 1, diff 1); when one does, it is a parameter, not a richer return. Supersedes #824.

Evidence of completion

Plan and design documents

Kind Document
Plan Not yet opened
Design docs/architecture/6.3-command-execution.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions