Internal

internal/app/complete

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

import "github.com/nilstate/scafld/v2/internal/app/complete"

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

Variables

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

Source: internal/app/complete/complete.go:20

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

Functions

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

Source: internal/app/complete/complete.go:49

Run completes a reviewed task and records completion evidence.

Types

type Clock

Source: internal/app/complete/complete.go:46

Clock supplies completion timestamps.

type Clock interface{ Now() time.Time }
Methods
  • Now func() time.Time

type SessionStore

Source: internal/app/complete/complete.go:29

SessionStore is the session evidence port used by completion.

type SessionStore interface {
	Append(context.Context, string, session.Entry, string) (session.Session, error)
	Load(context.Context, string) (session.Session, error)
}
Methods
  • Append func(context.Context, string, session.Entry, string) (session.Session, error)
  • Load func(context.Context, string) (session.Session, error)

type SpecStore

Source: internal/app/complete/complete.go:23

SpecStore is the spec persistence port used by completion.

type SpecStore interface {
	Load(context.Context, string) (spec.Model, string, error)
	Save(context.Context, string, spec.Model) error
}
Methods
  • Load func(context.Context, string) (spec.Model, string, error)
  • Save func(context.Context, string, spec.Model) error

type WorkspaceStatus

Source: internal/app/complete/complete.go:36

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

type WorkspaceStatus interface {
	ChangedFiles(context.Context) ([]string, error)
	ResolveHead(context.Context) (string, bool, error)
}
Methods
  • ChangedFiles func(context.Context) ([]string, error)
  • ResolveHead func(context.Context) (string, bool, error)