# internal/app/plan

Package plan creates draft specs from operator input.

## ErrMissingSpecStore

```go
var ErrMissingSpecStore = errors.New("missing spec store")
```

ErrMissingSpecStore is returned when planning has no spec store.

## Run

```go
func Run(ctx context.Context, store SpecStore, clock Clock, input Input) (Output, error)
```

Run creates a draft spec from input.

## Clock

```go
type Clock interface {
	Now() time.Time
}
```

Clock supplies planning timestamps.

- `Now: func() time.Time`: 

## Input

```go
type Input struct {
	TaskID  string
	Title   string
	Summary string
	Command string
	Size    string
	Risk    string
}
```

Input describes the operator-provided draft spec fields.

- `TaskID: string`: 
- `Title: string`: 
- `Summary: string`: 
- `Command: string`: 
- `Size: string`: 
- `Risk: string`: 

## Output

```go
type Output struct {
	TaskID string      `json:"task_id"`
	Path   string      `json:"path"`
	Status spec.Status `json:"status"`
}
```

Output describes the created draft spec.

- `TaskID: string` (json:"task_id"): 
- `Path: string` (json:"path"): 
- `Status: spec.Status` (json:"status"): 

## SpecStore

```go
type SpecStore interface {
	CreateDraft(context.Context, spec.Model) (string, error)
}
```

SpecStore is the spec creation port used by planning.

- `CreateDraft: func(context.Context, spec.Model) (string, error)`:
