# internal/adapters/cli/output

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

## Build

```go
func Build(out appbuild.Output) string
```

Build formats build evidence and repair details when acceptance blocks.

## CodeName

```go
func CodeName(exit int) string
```

CodeName maps process exit codes to stable JSON error codes.

## ConfigGateError

```go
func ConfigGateError(err error) error
```

ConfigGateError wraps config loading failures in the shared repair contract.

## EncodeEnvelope

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

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

## Gate

```go
func Gate(failure *gate.Failure) string
```

Gate formats a deterministic gate failure for human CLI output.

## GateFailure

```go
func GateFailure(err error) *gate.Failure
```

GateFailure extracts a deterministic gate payload from err when present.

## GateFailureFromResult

```go
func GateFailureFromResult(result any) *gate.Failure
```

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

## Report

```go
func Report(out appreport.Output) string
```

Report formats workspace reporting metrics.

## Review

```go
func Review(out appreview.Output) string
```

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

## ReviewProviderGateError

```go
func ReviewProviderGateError(err error) error
```

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

## Status

```go
func Status(out appstatus.Output) string
```

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

## StatusCommandExit

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

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

## StatusResult

```go
func StatusResult(out appstatus.Output) any
```

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