regress

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DriftCategoryNewWritePaths           = "new_write_paths"
	DriftCategoryNewDeployPaths          = "new_deploy_paths"
	DriftCategoryNewCredentials          = "new_credentials"
	DriftCategoryNewUnknownApproval      = "new_unknown_approval_evidence"
	DriftCategoryResolvedGaps            = "resolved_gaps"
	DriftCategoryWorsenedPaths           = "worsened_paths"
	DriftCategoryNewContradictions       = "new_contradictions"
	DriftCategoryPathsReadyForControl    = "paths_ready_for_control"
	DriftCategoryRemovedPaths            = "removed_paths"
	DriftCategoryChangedAuthority        = "changed_authority"
	DriftCategoryChangedEvidence         = "changed_evidence"
	DriftCategoryChangedTargetClass      = "changed_target_class"
	DriftComparisonStatusOK              = "ok"
	DriftComparisonStatusBaselineMissing = "baseline_action_paths_unavailable"
	DriftComparisonStatusCurrentMissing  = "current_action_paths_unavailable"
	DriftComparisonStatusIncomplete      = "comparison_incomplete"
)
View Source
const (
	DefaultBaselineFilename  = "wrkr-regress-baseline.json"
	DefaultSummaryMDFilename = "wrkr-regress-summary.md"
)
View Source
const (
	ReasonNewUnapprovedTool         = "new_unapproved_tool"
	ReasonRevokedToolReappeared     = "revoked_tool_reappeared"
	ReasonDeprecatedToolReappeared  = "deprecated_tool_reappeared"
	ReasonPermissionExpansion       = "unapproved_permission_expansion"
	ReasonCriticalAttackPath        = "critical_attack_path_drift"
	ReasonNewUnknownAutomation      = "new_unknown_automation"
	ReasonNewRepoWritePath          = "new_repo_write_path"
	ReasonNewSecretBearingWorkflow  = "new_secret_bearing_workflow"
	ReasonNewMCPToolConfig          = "new_mcp_tool_config"
	ReasonApprovalExpired           = "approval_expired"
	ReasonOwnerChanged              = "owner_changed"
	ReasonApprovedPathRiskIncreased = "approved_path_risk_increased"
	ReasonDeprecatedPathReappeared  = "deprecated_path_reappeared"
)
View Source
const BaselineVersion = "v1"

Variables

This section is empty.

Functions

func SaveBaseline

func SaveBaseline(path string, baseline Baseline) error

Types

type ActionPathState added in v1.6.0

type ActionPathState struct {
	PathID                       string   `json:"path_id,omitempty"`
	ResolutionKey                string   `json:"resolution_key,omitempty"`
	MatchKey                     string   `json:"match_key,omitempty"`
	Platform                     string   `json:"platform,omitempty"`
	Org                          string   `json:"org"`
	Repo                         string   `json:"repo"`
	Location                     string   `json:"location,omitempty"`
	ToolType                     string   `json:"tool_type,omitempty"`
	ActionPathType               string   `json:"action_path_type,omitempty"`
	TargetClass                  string   `json:"target_class,omitempty"`
	BoundaryLabel                string   `json:"boundary_label,omitempty"`
	ControlResolutionState       string   `json:"control_resolution_state,omitempty"`
	ReviewLifecycleState         string   `json:"review_lifecycle_state,omitempty"`
	PreviousReviewLifecycleState string   `json:"previous_review_lifecycle_state,omitempty"`
	ResolvedVisibility           string   `json:"resolved_visibility,omitempty"`
	ReopenState                  string   `json:"reopen_state,omitempty"`
	DelegationReadinessState     string   `json:"delegation_readiness_state,omitempty"`
	ApprovalEvidenceState        string   `json:"approval_evidence_state,omitempty"`
	OwnerEvidenceState           string   `json:"owner_evidence_state,omitempty"`
	ProofEvidenceState           string   `json:"proof_evidence_state,omitempty"`
	RuntimeEvidenceState         string   `json:"runtime_evidence_state,omitempty"`
	TargetEvidenceState          string   `json:"target_evidence_state,omitempty"`
	CredentialEvidenceState      string   `json:"credential_evidence_state,omitempty"`
	WriteCapable                 bool     `json:"write_capable,omitempty"`
	DeployWrite                  bool     `json:"deploy_write,omitempty"`
	ProductionWrite              bool     `json:"production_write,omitempty"`
	CredentialAccess             bool     `json:"credential_access,omitempty"`
	ApprovalGap                  bool     `json:"approval_gap,omitempty"`
	RiskScore                    float64  `json:"risk_score,omitempty"`
	ContradictionCount           int      `json:"contradiction_count,omitempty"`
	ActionClasses                []string `json:"action_classes,omitempty"`
	WritePathClasses             []string `json:"write_path_classes,omitempty"`
	AuthorityBindings            []string `json:"authority_bindings,omitempty"`
	CredentialSubjects           []string `json:"credential_subjects,omitempty"`
	CredentialAuthority          string   `json:"credential_authority,omitempty"`
	ReviewScope                  string   `json:"review_scope,omitempty"`
	ReviewValidUntil             string   `json:"review_valid_until,omitempty"`
	ConfigFingerprint            string   `json:"config_fingerprint,omitempty"`
	EvidenceRefs                 []string `json:"evidence_refs,omitempty"`
	ReopenReasons                []string `json:"reopen_reasons,omitempty"`
}

type AttackPathDriftSummary added in v1.0.5

type AttackPathDriftSummary struct {
	BaselineCriticalCount int                     `json:"baseline_critical_count"`
	CurrentCriticalCount  int                     `json:"current_critical_count"`
	Added                 []AttackPathState       `json:"added,omitempty"`
	Removed               []AttackPathState       `json:"removed,omitempty"`
	ScoreChanged          []AttackPathScoreChange `json:"score_changed,omitempty"`
	DriftCount            int                     `json:"drift_count"`
	DriftRatio            float64                 `json:"drift_ratio"`
	MinAbsolute           int                     `json:"min_absolute"`
	MinRelative           float64                 `json:"min_relative"`
}

type AttackPathScoreChange added in v1.0.5

type AttackPathScoreChange struct {
	PathID        string  `json:"path_id"`
	Org           string  `json:"org"`
	Repo          string  `json:"repo"`
	BaselineScore float64 `json:"baseline_score"`
	CurrentScore  float64 `json:"current_score"`
	ScoreDelta    float64 `json:"score_delta"`
}

type AttackPathState added in v1.0.5

type AttackPathState struct {
	PathID string  `json:"path_id"`
	Org    string  `json:"org"`
	Repo   string  `json:"repo"`
	Score  float64 `json:"score"`
}

type Baseline

type Baseline struct {
	Version             string              `json:"version"`
	GeneratedAt         string              `json:"generated_at"`
	Tools               []ToolState         `json:"tools"`
	AttackPaths         []AttackPathState   `json:"attack_paths,omitempty"`
	LifecycleGaps       []LifecycleGapState `json:"lifecycle_gaps,omitempty"`
	ActionPathsCaptured bool                `json:"action_paths_captured,omitempty"`
	ActionPaths         []ActionPathState   `json:"action_paths,omitempty"`
}

func BuildBaseline

func BuildBaseline(snapshot state.Snapshot, generatedAt time.Time) Baseline

func BuildBaselineFromSnapshot added in v1.0.8

func BuildBaselineFromSnapshot(snapshot state.Snapshot) Baseline

func LoadBaseline

func LoadBaseline(path string) (Baseline, error)

func LoadComparableBaseline added in v1.0.8

func LoadComparableBaseline(path string) (Baseline, error)

type DriftCategorySummary added in v1.6.0

type DriftCategorySummary struct {
	Category               string         `json:"category"`
	Severity               string         `json:"severity"`
	Priority               string         `json:"priority"`
	Count                  int            `json:"count"`
	AffectedPathRefs       []string       `json:"affected_path_refs,omitempty"`
	EvidenceRefs           []string       `json:"evidence_refs,omitempty"`
	RecommendedNextActions []string       `json:"recommended_next_actions,omitempty"`
	Examples               []DriftExample `json:"examples,omitempty"`
}

type DriftExample added in v1.6.0

type DriftExample struct {
	PathID                       string   `json:"path_id,omitempty"`
	BaselinePathID               string   `json:"baseline_path_id,omitempty"`
	CurrentPathRef               string   `json:"current_path_ref,omitempty"`
	BaselinePathRef              string   `json:"baseline_path_ref,omitempty"`
	Repo                         string   `json:"repo,omitempty"`
	Location                     string   `json:"location,omitempty"`
	BaselineLocation             string   `json:"baseline_location,omitempty"`
	CurrentTargetClass           string   `json:"current_target_class,omitempty"`
	BaselineTargetClass          string   `json:"baseline_target_class,omitempty"`
	CurrentBoundaryLabel         string   `json:"current_boundary_label,omitempty"`
	BaselineBoundaryLabel        string   `json:"baseline_boundary_label,omitempty"`
	CurrentAuthoritySummary      []string `json:"current_authority_summary,omitempty"`
	BaselineAuthoritySummary     []string `json:"baseline_authority_summary,omitempty"`
	CurrentEvidenceSummary       []string `json:"current_evidence_summary,omitempty"`
	BaselineEvidenceSummary      []string `json:"baseline_evidence_summary,omitempty"`
	CurrentEvidenceRefs          []string `json:"current_evidence_refs,omitempty"`
	BaselineEvidenceRefs         []string `json:"baseline_evidence_refs,omitempty"`
	CurrentReviewLifecycleState  string   `json:"current_review_lifecycle_state,omitempty"`
	BaselineReviewLifecycleState string   `json:"baseline_review_lifecycle_state,omitempty"`
	ReopenState                  string   `json:"reopen_state,omitempty"`
	ReopenReasons                []string `json:"reopen_reasons,omitempty"`
	Detail                       string   `json:"detail"`
	RecommendedNextAction        string   `json:"recommended_next_action,omitempty"`
}

type InventoryDiffResult added in v1.0.8

type InventoryDiffResult struct {
	Status                 string             `json:"status"`
	Drift                  bool               `json:"drift_detected"`
	BaselinePath           string             `json:"baseline_path,omitempty"`
	AddedCount             int                `json:"added_count"`
	RemovedCount           int                `json:"removed_count"`
	ChangedCount           int                `json:"changed_count"`
	ControlPathDrift       bool               `json:"control_path_drift_detected,omitempty"`
	ControlPathReasonCount int                `json:"control_path_reason_count,omitempty"`
	ControlPathReasons     []Reason           `json:"control_path_reasons,omitempty"`
	Added                  []source.Finding   `json:"added"`
	Removed                []source.Finding   `json:"removed"`
	Changed                []diff.ChangedItem `json:"changed"`
}

func CompareInventory added in v1.0.8

func CompareInventory(baseline, current state.Snapshot) InventoryDiffResult

type LifecycleGapState added in v1.3.0

type LifecycleGapState struct {
	AgentID         string `json:"agent_id"`
	AgentInstanceID string `json:"agent_instance_id,omitempty"`
	ToolID          string `json:"tool_id,omitempty"`
	Org             string `json:"org"`
	ReasonCode      string `json:"reason_code"`
}

type Reason

type Reason struct {
	Code              string                  `json:"code"`
	AgentID           string                  `json:"agent_id"`
	AgentInstanceID   string                  `json:"agent_instance_id,omitempty"`
	ToolID            string                  `json:"tool_id"`
	Org               string                  `json:"org"`
	Message           string                  `json:"message"`
	AddedPermissions  []string                `json:"added_permissions,omitempty"`
	PreviousOwner     string                  `json:"previous_owner,omitempty"`
	CurrentOwner      string                  `json:"current_owner,omitempty"`
	PreviousRiskScore float64                 `json:"previous_risk_score,omitempty"`
	CurrentRiskScore  float64                 `json:"current_risk_score,omitempty"`
	AttackPathDrift   *AttackPathDriftSummary `json:"attack_path_drift,omitempty"`
}

type Result

type Result struct {
	Status             string                 `json:"status"`
	Drift              bool                   `json:"drift_detected"`
	ReasonCount        int                    `json:"reason_count"`
	Reasons            []Reason               `json:"reasons"`
	DriftCategoryCount int                    `json:"drift_category_count,omitempty"`
	DriftCategories    []DriftCategorySummary `json:"drift_categories,omitempty"`
	ComparisonStatus   string                 `json:"comparison_status,omitempty"`
	ComparisonIssues   []string               `json:"comparison_issues,omitempty"`
	BaselinePath       string                 `json:"baseline_path,omitempty"`
	SummaryMDPath      string                 `json:"summary_md_path,omitempty"`
}

func Compare

func Compare(baseline Baseline, current state.Snapshot) Result

type ToolState

type ToolState struct {
	AgentID            string   `json:"agent_id"`
	AgentInstanceID    string   `json:"agent_instance_id,omitempty"`
	ToolID             string   `json:"tool_id"`
	Org                string   `json:"org"`
	Repo               string   `json:"repo,omitempty"`
	Location           string   `json:"location,omitempty"`
	Status             string   `json:"status"`
	ApprovalStatus     string   `json:"approval_status"`
	SecurityVisibility string   `json:"security_visibility,omitempty"`
	Owner              string   `json:"owner,omitempty"`
	EvidenceExpires    string   `json:"evidence_expires,omitempty"`
	WritePathClasses   []string `json:"write_path_classes,omitempty"`
	SecretBearing      bool     `json:"secret_bearing,omitempty"`
	Confidence         string   `json:"confidence,omitempty"`
	ControlPathType    string   `json:"control_path_type,omitempty"`
	RiskScore          float64  `json:"risk_score,omitempty"`
	Present            bool     `json:"present"`
	Permissions        []string `json:"permissions"`
	LegacyAgentID      string   `json:"-"`
}

func SnapshotTools

func SnapshotTools(snapshot state.Snapshot) []ToolState

Jump to

Keyboard shortcuts

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