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:61

Run reads status for taskID.

Types

type Output

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

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"`
}
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"`

type ReviewAttemptInfo

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

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:38

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"`
	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"`
  • 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:19

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:14

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)