# internal/adapters/cli/review

Package review selects review providers and pass agendas for the CLI adapter.

## BuildInput

```go
func BuildInput(opts InputOptions, selected Selection) appreview.Input
```

BuildInput maps CLI selection and flags to the app-layer review input.

## FirstNonEmpty

```go
func FirstNonEmpty(values ...string) string
```

FirstNonEmpty returns the first non-blank value.

## ModeFromValue

```go
func ModeFromValue(mode string) corereview.Mode
```

ModeFromValue resolves the CLI mode value into the provider review mode.

## PositiveInt

```go
func PositiveInt(value string) int
```

PositiveInt parses non-negative integer CLI values. Invalid values use the unset value because review budgets are advisory, not gate inputs.

## PositiveOrDefault

```go
func PositiveOrDefault(value int, fallback int) int
```

PositiveOrDefault returns fallback when value is unset.

## PrintHelp

```go
func PrintHelp(w io.Writer)
```

PrintHelp writes command-specific review help.

## Select

```go
func Select(ctx context.Context, opts Options) (Selection, error)
```

Select loads config, applies CLI overrides, and returns a review provider.

## SplitScope

```go
func SplitScope(value string) []string
```

SplitScope parses comma-separated review scope paths.

## InputOptions

```go
type InputOptions struct {
	TaskID           string
	Mode             string
	ReviewScope      string
	MaxFindings      string
	MinAttackAngles  string
	ReviewDepth      string
	ForceReview      bool
	PrintContext     bool
	HumanReviewed    bool
	RepairPacketPath string
	Reason           string
}
```

InputOptions carries CLI review flags into the app input assembler.

- `TaskID: string`: 
- `Mode: string`: 
- `ReviewScope: string`: 
- `MaxFindings: string`: 
- `MinAttackAngles: string`: 
- `ReviewDepth: string`: 
- `ForceReview: bool`: 
- `PrintContext: bool`: 
- `HumanReviewed: bool`: 
- `RepairPacketPath: string`: 
- `Reason: string`: 

## Options

```go
type Options struct {
	Root             string
	TaskID           string
	Provider         string
	Command          string
	ProviderBinary   string
	Model            string
	DiagnosticsPath  string
	Progress         io.Writer
	PrintContext     bool
	RepairPacketPath string
}
```

Options configures review-provider selection for the CLI.

- `Root: string`: 
- `TaskID: string`: 
- `Provider: string`: 
- `Command: string`: 
- `ProviderBinary: string`: 
- `Model: string`: 
- `DiagnosticsPath: string`: 
- `Progress: io.Writer`: 
- `PrintContext: bool`: 
- `RepairPacketPath: string`: 

## Selection

```go
type Selection struct {
	Provider                appreview.Provider
	ProviderName            string
	ProviderModel           string
	Passes                  []appreview.Pass
	Invariants              map[string]string
	ContextSections         []reviewcontext.Section
	ContextMaxBytes         int
	RequiredContextMaxBytes int
	Contract                corecontract.Contract
	Dossier                 configadapter.ReviewDossierConfig
	EvidenceRoots           []string
}
```

Selection is the provider and review agenda chosen for a review run.

- `Provider: appreview.Provider`: 
- `ProviderName: string`: 
- `ProviderModel: string`: 
- `Passes: []appreview.Pass`: 
- `Invariants: map[string]string`: 
- `ContextSections: []reviewcontext.Section`: 
- `ContextMaxBytes: int`: 
- `RequiredContextMaxBytes: int`: 
- `Contract: corecontract.Contract`: 
- `Dossier: configadapter.ReviewDossierConfig`: 
- `EvidenceRoots: []string`:
