# internal/app/taskstate

Package taskstate contains the small workspace projections shared by taskless lifecycle entry points.

## Current

```go
func Current(ctx context.Context, specs SpecLister) ([]spec.Record, error)
```

Current returns non-terminal task specs in stable task-id order.

## ReadyForFinalize

```go
func ReadyForFinalize(ctx context.Context, specs SpecLister, sessions SessionLoader) ([]spec.Record, error)
```

ReadyForFinalize returns current review tasks with a valid accepted review. A task is not selected merely because it is in the review phase: pending or failed review work must remain visible to an explicitly addressed command.

## SessionLoader

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

SessionLoader is the read-only evidence lookup used to identify tasks whose accepted review is actually ready for deterministic finalization.

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

## SpecLister

```go
type SpecLister interface {
	List(context.Context) ([]spec.Record, error)
}
```

SpecLister is the read-only workspace listing needed to resolve taskless lifecycle calls without guessing which task an agent owns.

- `List: func(context.Context) ([]spec.Record, error)`:
