# internal/app/complete

Package complete closes reviewed work after the review gate has passed.

## ErrReviewGate

```go
var ErrReviewGate = errors.New("review gate has not passed")
```

ErrReviewGate is returned when completion is attempted before a passing review.

## Run

```go
func Run(ctx context.Context, specs SpecStore, sessions SessionStore, workspace WorkspaceStatus, clock Clock, taskID string) (spec.Model, error)
```

Run completes a reviewed task and records completion evidence.

## Clock

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

Clock supplies completion timestamps.

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

## SessionStore

```go
type SessionStore interface {
	Append(context.Context, string, session.Entry, string) (session.Session, error)
	Load(context.Context, string) (session.Session, error)
}
```

SessionStore is the session evidence port used by completion.

- `Append: func(context.Context, string, session.Entry, string) (session.Session, error)`: 
- `Load: func(context.Context, string) (session.Session, error)`: 

## SpecStore

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

SpecStore is the spec persistence port used by completion.

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

## WorkspaceStatus

```go
type WorkspaceStatus interface {
	ChangedFiles(context.Context) ([]string, error)
	ResolveHead(context.Context) (string, bool, error)
}
```

WorkspaceStatus captures the current Git-visible workspace state for stale review checks at completion time.

- `ChangedFiles: func(context.Context) ([]string, error)`: 
- `ResolveHead: func(context.Context) (string, bool, error)`:
