scout

package
v1.3.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendAdoptionEvent

func AppendAdoptionEvent(path string, event schemascout.AdoptionEvent) error

func AppendOperationalEvent

func AppendOperationalEvent(path string, event schemascout.OperationalEvent) error

func BuildSignalReport

func BuildSignalReport(input SignalInput, opts SignalOptions) (schemascout.SignalReport, error)

func LoadAdoptionEvents

func LoadAdoptionEvents(path string) ([]schemascout.AdoptionEvent, error)

func LoadOperationalEvents

func LoadOperationalEvents(path string) ([]schemascout.OperationalEvent, error)

func NewAdoptionEvent

func NewAdoptionEvent(
	command string,
	exitCode int,
	elapsed time.Duration,
	producerVersion string,
	now time.Time,
	workflowID string,
) schemascout.AdoptionEvent

func NewOperationalEndEvent

func NewOperationalEndEvent(
	command string,
	correlationID string,
	producerVersion string,
	exitCode int,
	errorCategory string,
	retryable bool,
	elapsed time.Duration,
	now time.Time,
) schemascout.OperationalEvent

func NewOperationalStartEvent

func NewOperationalStartEvent(
	command string,
	correlationID string,
	producerVersion string,
	now time.Time,
) schemascout.OperationalEvent

Types

type AdoptionCommandStats

type AdoptionCommandStats struct {
	Command string `json:"command"`
	Total   int    `json:"total"`
	Success int    `json:"success"`
	Failure int    `json:"failure"`
}

type AdoptionMilestoneStatus

type AdoptionMilestoneStatus struct {
	Name     string `json:"name"`
	Achieved bool   `json:"achieved"`
}

type AdoptionReport

type AdoptionReport struct {
	SchemaID           string                       `json:"schema_id"`
	SchemaVersion      string                       `json:"schema_version"`
	CreatedAt          time.Time                    `json:"created_at"`
	ProducerVersion    string                       `json:"producer_version"`
	Source             string                       `json:"source"`
	TotalEvents        int                          `json:"total_events"`
	SuccessEvents      int                          `json:"success_events"`
	FailedEvents       int                          `json:"failed_events"`
	FirstEventAt       time.Time                    `json:"first_event_at,omitempty"`
	LastEventAt        time.Time                    `json:"last_event_at,omitempty"`
	Commands           []AdoptionCommandStats       `json:"commands"`
	Milestones         []AdoptionMilestoneStatus    `json:"milestones"`
	ActivationTimingMS map[string]int64             `json:"activation_timing_ms,omitempty"`
	ActivationMedians  map[string]int64             `json:"activation_medians_ms,omitempty"`
	SkillWorkflows     []AdoptionSkillWorkflowStats `json:"skill_workflows,omitempty"`
	ActivationComplete bool                         `json:"activation_complete"`
	Blockers           []string                     `json:"blockers,omitempty"`
}

func BuildAdoptionReport

func BuildAdoptionReport(
	events []schemascout.AdoptionEvent,
	source string,
	producerVersion string,
	now time.Time,
) AdoptionReport

type AdoptionSkillWorkflowStats

type AdoptionSkillWorkflowStats struct {
	Workflow              string  `json:"workflow"`
	Total                 int     `json:"total"`
	Success               int     `json:"success"`
	Failure               int     `json:"failure"`
	SuccessRate           float64 `json:"success_rate"`
	MedianRuntimeMS       int64   `json:"median_runtime_ms"`
	MostCommonFailureCode int     `json:"most_common_failure_code,omitempty"`
}

type CoverageReport

type CoverageReport struct {
	SnapshotID             string   `json:"snapshot_id"`
	DiscoveredTools        int      `json:"discovered_tools"`
	GatedTools             int      `json:"gated_tools"`
	HighRiskUngatedTools   int      `json:"high_risk_ungated_tools"`
	CoveragePercent        float64  `json:"coverage_percent"`
	PolicyDigests          []string `json:"policy_digests,omitempty"`
	DiscoveredToolNames    []string `json:"discovered_tool_names,omitempty"`
	GatedToolNames         []string `json:"gated_tool_names,omitempty"`
	HighRiskUngatedToolIDs []string `json:"high_risk_ungated_tool_ids,omitempty"`
}

func BuildCoverage

func BuildCoverage(snapshot schemascout.InventorySnapshot, policyPaths []string) (CoverageReport, error)

type DefaultProvider

type DefaultProvider struct {
	Options SnapshotOptions
}

func (DefaultProvider) Snapshot

type DiffChange

type DiffChange struct {
	ID              string `json:"id"`
	Kind            string `json:"kind"`
	Name            string `json:"name"`
	BeforeLocator   string `json:"before_locator"`
	AfterLocator    string `json:"after_locator"`
	BeforeRiskLevel string `json:"before_risk_level,omitempty"`
	AfterRiskLevel  string `json:"after_risk_level,omitempty"`
}

type DiffItem

type DiffItem struct {
	ID        string `json:"id"`
	Kind      string `json:"kind"`
	Name      string `json:"name"`
	Locator   string `json:"locator"`
	RiskLevel string `json:"risk_level,omitempty"`
}

type InventoryProvider

type InventoryProvider interface {
	Snapshot(context.Context, SnapshotRequest) (schemascout.InventorySnapshot, error)
}

type SignalInput

type SignalInput struct {
	RunpackPaths []string
	TracePaths   []string
	RegressPaths []string
}

type SignalOptions

type SignalOptions struct {
	ProducerVersion string
	Now             time.Time
}

type SnapshotDiff

type SnapshotDiff struct {
	LeftSnapshotID  string       `json:"left_snapshot_id"`
	RightSnapshotID string       `json:"right_snapshot_id"`
	Added           []DiffItem   `json:"added,omitempty"`
	Removed         []DiffItem   `json:"removed,omitempty"`
	Changed         []DiffChange `json:"changed,omitempty"`
	AddedCount      int          `json:"added_count"`
	RemovedCount    int          `json:"removed_count"`
	ChangedCount    int          `json:"changed_count"`
}

type SnapshotOptions

type SnapshotOptions struct {
	ProducerVersion string
	Now             time.Time
}

type SnapshotRequest

type SnapshotRequest struct {
	Roots   []string
	Include []string
	Exclude []string
}

type TopAction

type TopAction struct {
	Rank           int      `json:"rank"`
	Score          int      `json:"score"`
	ToolClass      string   `json:"tool_class"`
	BlastRadius    int      `json:"blast_radius"`
	RunID          string   `json:"run_id"`
	IntentID       string   `json:"intent_id,omitempty"`
	IntentDigest   string   `json:"intent_digest,omitempty"`
	TraceID        string   `json:"trace_id,omitempty"`
	ToolName       string   `json:"tool_name"`
	Verdict        string   `json:"verdict,omitempty"`
	ReasonCodes    []string `json:"reason_codes,omitempty"`
	SourceType     string   `json:"source_type"`
	SourceArtifact string   `json:"source_artifact"`
}

type TopActionsInput

type TopActionsInput struct {
	RunpackPaths []string
	TracePaths   []string
	Limit        int
}

type TopActionsOptions

type TopActionsOptions struct {
	ProducerVersion string
	Now             time.Time
}

type TopActionsReport

type TopActionsReport struct {
	SchemaID        string      `json:"schema_id"`
	SchemaVersion   string      `json:"schema_version"`
	CreatedAt       time.Time   `json:"created_at"`
	ProducerVersion string      `json:"producer_version"`
	RunCount        int         `json:"run_count"`
	TraceCount      int         `json:"trace_count"`
	ActionCount     int         `json:"action_count"`
	TopActions      []TopAction `json:"top_actions"`
}

func BuildTopActionsReport

func BuildTopActionsReport(input TopActionsInput, opts TopActionsOptions) (TopActionsReport, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL