Documentation
¶
Overview ¶
Package verify evaluates lightweight post-step / post-run assertions (exit code, stdout substring, file presence) used by Missions and MCP.
Index ¶
Constants ¶
const SuiteID = "vaultrun-verify-controls-v1"
SuiteID is the frozen identity of the built-in verify control suite.
Variables ¶
This section is empty.
Functions ¶
func SuiteFingerprint ¶
func SuiteFingerprint() string
SuiteFingerprint returns a stable digest of the frozen control definitions.
Types ¶
type Check ¶
type Check struct {
Name string `json:"name"`
Passed bool `json:"passed"`
Detail string `json:"detail,omitempty"`
}
Check is one assertion outcome.
type ControlCase ¶
type ControlCase struct {
ID string `json:"id"`
Kind ControlKind `json:"kind"`
Name string `json:"name"`
Description string `json:"description"`
Spec Spec `json:"spec"`
Observation Observation `json:"observation"`
FileExistsMap map[string]bool `json:"-"` // probe fixture; not part of public digest payload separately
ExpectedPassed bool `json:"expected_passed"`
}
ControlCase is one frozen evaluator control (FaultWright-style).
func ControlCasesPublic ¶
func ControlCasesPublic() []ControlCase
ControlCasesPublic returns the frozen cases without running them (for docs/debug).
type ControlKind ¶
type ControlKind string
ControlKind is positive (must pass) or negative (must fail).
const ( ControlPositive ControlKind = "positive" ControlNegative ControlKind = "negative" )
type ControlOutcome ¶
type ControlOutcome struct {
ID string `json:"id"`
Kind ControlKind `json:"kind"`
Name string `json:"name"`
Description string `json:"description"`
ExpectedPassed bool `json:"expected_passed"`
ObservedPassed bool `json:"observed_passed"`
Consistent bool `json:"consistent"`
Result Result `json:"result"`
}
ControlOutcome is the evaluation of one control against the live evaluator.
type ControlReport ¶
type ControlReport struct {
SuiteID string `json:"suite_id"`
Fingerprint string `json:"fingerprint"`
CreatedAt time.Time `json:"created_at"`
Passed bool `json:"passed"`
PipelineDiscriminates bool `json:"pipeline_discriminates"`
Controls []ControlOutcome `json:"controls"`
Summary string `json:"summary"`
}
ControlReport is the auditable record for a control-suite run.
func RunControls ¶
func RunControls() ControlReport
RunControls evaluates the frozen positive/negative suite against Evaluate. PipelineDiscriminates is true only when every control is consistent with expectation and the suite contains at least one passing positive and one failing negative observation.
type FileProbe ¶
FileProbe reports whether a workspace-relative path exists. May be nil when Spec.FileExists is empty.
type Observation ¶
type Observation struct {
ExitCode *int `json:"exit_code,omitempty"`
Stdout string `json:"stdout,omitempty"`
Stderr string `json:"stderr,omitempty"`
}
Observation is the measured outcome to check against Spec.
type Record ¶
type Record struct {
ID uuid.UUID `db:"id" json:"id"`
SessionID *uuid.UUID `db:"session_id" json:"session_id,omitempty"`
RunID *uuid.UUID `db:"run_id" json:"run_id,omitempty"`
MissionRunID *uuid.UUID `db:"mission_run_id" json:"mission_run_id,omitempty"`
StepName string `db:"step_name" json:"step_name,omitempty"`
Spec json.RawMessage `db:"spec" json:"spec"`
Observation json.RawMessage `db:"observation" json:"observation"`
Passed bool `db:"passed" json:"passed"`
Checks json.RawMessage `db:"checks" json:"checks"`
CreatedAt time.Time `db:"created_at" json:"created_at"`
}
Record is a persisted verification outcome.
type Spec ¶
type Spec struct {
ExitCodeZero *bool `json:"exit_code_zero,omitempty"`
StdoutContains string `json:"stdout_contains,omitempty"`
FileExists string `json:"file_exists,omitempty"`
}
Spec is a set of optional assertions. Empty fields are skipped.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists verification results.