Internal

internal/app/status

Package status reads the current task state and suggested next action.

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

Package status reads the current task state and suggested next action.

Functions

func Run(ctx context.Context, specs SpecStore, sessions SessionStore, taskID string) (Output, error)

Source: internal/app/status/status.go:81

Run reads status for taskID.

Types

type CompletionInfo

Source: internal/app/status/status.go:67

CompletionInfo describes the terminal review authority for completed tasks.

type CompletionInfo struct {
	Status        string   `json:"status"`
	Kind          string   `json:"kind"`
	Provider      string   `json:"provider,omitempty"`
	Verdict       string   `json:"verdict,omitempty"`
	Reason        string   `json:"reason,omitempty"`
	Actual        string   `json:"actual,omitempty"`
	Summary       string   `json:"summary,omitempty"`
	ReviewEvent   string   `json:"review_event,omitempty"`
	CompleteEvent string   `json:"complete_event,omitempty"`
	Evidence      []string `json:"evidence,omitempty"`
}
Fields
  • Status string `json:"status"`
  • Kind string `json:"kind"`
  • Provider string `json:"provider,omitempty"`
  • Verdict string `json:"verdict,omitempty"`
  • Reason string `json:"reason,omitempty"`
  • Actual string `json:"actual,omitempty"`
  • Summary string `json:"summary,omitempty"`
  • ReviewEvent string `json:"review_event,omitempty"`
  • CompleteEvent string `json:"complete_event,omitempty"`
  • Evidence []string `json:"evidence,omitempty"`

type Output

Source: internal/app/status/status.go:25

Output describes the task status projection.

type Output struct {
	TaskID          string          `json:"task_id"`
	Status          spec.Status     `json:"status"`
	Title           string          `json:"title"`
	Next            string          `json:"next"`
	Gate            string          `json:"gate,omitempty"`
	TrustedState    string          `json:"trusted_state,omitempty"`
	AllowedFollowUp string          `json:"allowed_follow_up,omitempty"`
	SessionOK       bool            `json:"session_ok"`
	Repair          *gate.Failure   `json:"repair,omitempty"`
	Review          ReviewInfo      `json:"review,omitempty"`
	Completion      *CompletionInfo `json:"completion_authority,omitempty"`
}
Fields
  • TaskID string `json:"task_id"`
  • Status spec.Status `json:"status"`
  • Title string `json:"title"`
  • Next string `json:"next"`
  • Gate string `json:"gate,omitempty"`
  • TrustedState string `json:"trusted_state,omitempty"`
  • AllowedFollowUp string `json:"allowed_follow_up,omitempty"`
  • SessionOK bool `json:"session_ok"`
  • Repair *gate.Failure `json:"repair,omitempty"`
  • Review ReviewInfo `json:"review,omitempty"`
  • Completion *CompletionInfo `json:"completion_authority,omitempty"`

type ReviewAttemptInfo

Source: internal/app/status/status.go:60

ReviewAttemptInfo describes the latest provider attempt separately from the latest accepted review verdict.

type ReviewAttemptInfo struct {
	Running bool   `json:"running"`
	Status  string `json:"status"`
	Reason  string `json:"reason,omitempty"`
}
Fields
  • Running bool `json:"running"`
  • Status string `json:"status"`
  • Reason string `json:"reason,omitempty"`

type ReviewInfo

Source: internal/app/status/status.go:40

ReviewInfo is the latest review evidence visible from status.

type ReviewInfo struct {
	Verdict        string                      `json:"verdict,omitempty"`
	Mode           corereview.Mode             `json:"mode,omitempty"`
	Summary        string                      `json:"summary,omitempty"`
	Findings       []corereview.Finding        `json:"findings,omitempty"`
	OpenBlockers   int                         `json:"open_blockers,omitempty"`
	AttackLog      []corereview.AttackLogEntry `json:"attack_log,omitempty"`
	Budget         corereview.Budget           `json:"budget,omitempty"`
	Provider       string                      `json:"provider,omitempty"`
	Model          string                      `json:"model,omitempty"`
	OutputFormat   string                      `json:"output_format,omitempty"`
	Normalizations []string                    `json:"normalizations,omitempty"`
	Attempt        *ReviewAttemptInfo          `json:"attempt,omitempty"`
	Running        bool                        `json:"running,omitempty"`
	AttemptStatus  string                      `json:"attempt_status,omitempty"`
	Reason         string                      `json:"reason,omitempty"`
}
Fields
  • Verdict string `json:"verdict,omitempty"`
  • Mode corereview.Mode `json:"mode,omitempty"`
  • Summary string `json:"summary,omitempty"`
  • Findings []corereview.Finding `json:"findings,omitempty"`
  • OpenBlockers int `json:"open_blockers,omitempty"`
  • AttackLog []corereview.AttackLogEntry `json:"attack_log,omitempty"`
  • Budget corereview.Budget `json:"budget,omitempty"`
  • Provider string `json:"provider,omitempty"`
  • Model string `json:"model,omitempty"`
  • OutputFormat string `json:"output_format,omitempty"`
  • Normalizations []string `json:"normalizations,omitempty"`
  • Attempt *ReviewAttemptInfo `json:"attempt,omitempty"`
  • Running bool `json:"running,omitempty"`
  • AttemptStatus string `json:"attempt_status,omitempty"`
  • Reason string `json:"reason,omitempty"`

type SessionStore

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

SessionStore is the session loading port used by status.

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

type SpecStore

Source: internal/app/status/status.go:15

SpecStore is the spec loading port used by status.

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