Internal

internal/adapters/cli/output

Package output formats human-readable command output for the CLI adapter.

import "github.com/nilstate/scafld/v2/internal/adapters/cli/output"

Package output formats human-readable command output for the CLI adapter.

Functions

func Build(out appbuild.Output) string

Source: internal/adapters/cli/output/output.go:156

Build formats build evidence and repair details when acceptance blocks.

func CodeName(exit int) string

Source: internal/adapters/cli/output/output.go:33

CodeName maps process exit codes to stable JSON error codes.

func ConfigGateError(err error) error

Source: internal/adapters/cli/output/output.go:82

ConfigGateError wraps config loading failures in the shared repair contract.

func EncodeEnvelope[T any](w io.Writer, env envelope.Envelope[T], exit int) int

Source: internal/adapters/cli/output/output.go:22

EncodeEnvelope writes env as one JSON line, surfacing an encode failure on the stream and refusing to report success (exit 0) over corrupt output.

func Gate(failure *gate.Failure) string

Source: internal/adapters/cli/output/output.go:117

Gate formats a deterministic gate failure for human CLI output.

func GateFailure(err error) *gate.Failure

Source: internal/adapters/cli/output/output.go:63

GateFailure extracts a deterministic gate payload from err when present.

func GateFailureFromResult(result any) *gate.Failure

Source: internal/adapters/cli/output/output.go:73

GateFailureFromResult extracts repair payloads from non-zero successful use-case outputs.

func Report(out appreport.Output) string

Source: internal/adapters/cli/output/output.go:367

Report formats workspace reporting metrics.

func Review(out appreview.Output) string

Source: internal/adapters/cli/output/output.go:171

Review formats the review gate result so findings are visible in the normal path.

func ReviewProviderGateError(err error) error

Source: internal/adapters/cli/output/output.go:100

ReviewProviderGateError wraps provider-selection failures in the shared review gate repair contract.

func Status(out appstatus.Output) string

Source: internal/adapters/cli/output/output.go:231

Status formats status output with the latest review findings when present.

func StatusCommandExit(command string, err error, generic int, validation int) int

Source: internal/adapters/cli/output/output.go:52

StatusCommandExit maps complete/fail/cancel wrapper errors onto the public exit-code table without making the top-level CLI adapter interpret gate data.

func StatusResult(out appstatus.Output) any

Source: internal/adapters/cli/output/output.go:326

StatusResult keeps the taskless probe small instead of serializing an empty task projection as if it were a real task.