# internal/adapters/cli/harden

Package harden builds the CLI-facing prompt context for hardening rounds.

## BuildInput

```go
func BuildInput(ctx context.Context, opts RunOptions) (appharden.Input, error)
```

BuildInput returns the app-layer harden input for CLI execution.

## Contract

```go
func Contract(ctx context.Context, root string) (corecontract.Contract, error)
```

Contract returns the hardening contract plus relevant workspace configuration context.

## Prompt

```go
func Prompt(ctx context.Context, root string) string
```

Prompt returns the manual hardening prompt. Provider hardening receives the same shared contract with a provider-specific output contract instead.

## ResultText

```go
func ResultText(stderr io.Writer, out appharden.Output) (string, bool)
```

ResultText formats non-JSON harden output. The boolean reports whether the text should be wrapped in the standard success envelope.

## Select

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

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

## Options

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

Options configures harden-provider selection for the CLI.

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

## RunOptions

```go
type RunOptions struct {
	Root             string
	TaskID           string
	MarkPassed       bool
	Provider         string
	Command          string
	ProviderBinary   string
	Model            string
	SuppressContext  bool
	RepairPacketPath string
	Progress         io.Writer
}
```

RunOptions configures the app harden input assembled by the CLI adapter.

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

## Selection

```go
type Selection struct {
	Provider                appharden.Provider
	ContextMaxBytes         int
	RequiredContextMaxBytes int
	EvidenceRoots           []string
}
```

Selection is the provider and context budget chosen for a harden run.

- `Provider: appharden.Provider`: 
- `ContextMaxBytes: int`: 
- `RequiredContextMaxBytes: int`: 
- `EvidenceRoots: []string`:
