Documentation
¶
Index ¶
- Constants
- func GoalContractWarnings(goal project.Goal, input GoalCheckInput) []string
- func RootErrorFingerprint(message string) string
- func WriteFailureBundle(run project.Run, bundle FailureBundle) error
- func WriteNormalizedEvidence(run project.Run, normalized NormalizedEvidence) error
- type Artifact
- type AttemptContext
- type BudgetMetadata
- type ChangedFile
- type Compiler
- type EvidenceSource
- type FailureBundle
- type GoalCheckInput
- type GoalContract
- type NormalizedEvidence
- type Normalizer
- type RunMetadata
- type SafetyEngine
- type SafetyFinding
- type SafetyInput
- type Signal
Constants ¶
View Source
const ( SafetyDecisionWarn = "warn" SafetyDecisionStop = "stop" SafetyRuleRepeatedRootFailure = "repeated_root_failure" SafetyRuleGoalDrift = "goal_drift" SafetyRuleTestWeakening = "test_weakening" SafetyRuleDependencyChange = "dependency_change" SafetyRuleSuspiciousPathEdit = "suspicious_path_edit" )
View Source
const SchemaVersion = 1
Variables ¶
This section is empty.
Functions ¶
func GoalContractWarnings ¶
func GoalContractWarnings(goal project.Goal, input GoalCheckInput) []string
func RootErrorFingerprint ¶
func WriteFailureBundle ¶
func WriteFailureBundle(run project.Run, bundle FailureBundle) error
func WriteNormalizedEvidence ¶
func WriteNormalizedEvidence(run project.Run, normalized NormalizedEvidence) error
Types ¶
type AttemptContext ¶
type BudgetMetadata ¶
type ChangedFile ¶
type Compiler ¶
type Compiler struct {
Now func() time.Time
Safety project.SafetyConfig
}
func (Compiler) Compile ¶
func (c Compiler) Compile(run project.Run, goal project.Goal, normalized NormalizedEvidence) (FailureBundle, error)
type EvidenceSource ¶
type FailureBundle ¶
type FailureBundle struct {
Version int `yaml:"version"`
GeneratedAt time.Time `yaml:"generated_at"`
Run RunMetadata `yaml:"run"`
Goal GoalContract `yaml:"goal"`
Sources []EvidenceSource `yaml:"sources"`
AttemptContext AttemptContext `yaml:"attempt_context"`
Budget BudgetMetadata `yaml:"budget"`
RootErrorCandidates []Signal `yaml:"root_error_candidates"`
DownstreamSymptoms []Signal `yaml:"downstream_symptoms,omitempty"`
SafetyFindings []SafetyFinding `yaml:"safety_findings,omitempty"`
Artifacts []Artifact `yaml:"artifacts"`
Warnings []string `yaml:"warnings,omitempty"`
}
func ReadFailureBundle ¶
func ReadFailureBundle(run project.Run) (FailureBundle, error)
type GoalCheckInput ¶
type GoalContract ¶
type GoalContract struct {
Goal string `yaml:"goal"`
NonGoals []string `yaml:"non_goals,omitempty"`
MustPreserve []string `yaml:"must_preserve,omitempty"`
DoneConditions []string `yaml:"done_conditions,omitempty"`
ExpectedPaths []string `yaml:"expected_paths,omitempty"`
SuspiciousPaths []string `yaml:"suspicious_paths,omitempty"`
StopRules []string `yaml:"stop_rules,omitempty"`
}
type NormalizedEvidence ¶
type NormalizedEvidence struct {
Version int `yaml:"version"`
GeneratedAt time.Time `yaml:"generated_at"`
Run RunMetadata `yaml:"run"`
Sources []EvidenceSource `yaml:"sources"`
Signals []Signal `yaml:"signals"`
Warnings []string `yaml:"warnings,omitempty"`
}
func ReadNormalizedEvidence ¶
func ReadNormalizedEvidence(run project.Run) (NormalizedEvidence, error)
type Normalizer ¶
func (Normalizer) NormalizeRun ¶
func (n Normalizer) NormalizeRun(run project.Run) (NormalizedEvidence, error)
type RunMetadata ¶
type SafetyEngine ¶
type SafetyEngine struct {
Config project.SafetyConfig
}
func (SafetyEngine) Evaluate ¶
func (e SafetyEngine) Evaluate(input SafetyInput) []SafetyFinding
type SafetyFinding ¶
type SafetyInput ¶
type SafetyInput struct {
Bundle FailureBundle
Goal project.Goal
Signals []Signal
EditedPaths []string
ChangedFiles []ChangedFile
}
type Signal ¶
type Signal struct {
Type string `yaml:"type"`
Source string `yaml:"source"`
Job string `yaml:"job,omitempty"`
Message string `yaml:"message"`
File string `yaml:"file,omitempty"`
Line int `yaml:"line,omitempty"`
Confidence string `yaml:"confidence"`
RawExcerpt string `yaml:"raw_excerpt,omitempty"`
RawExcerptPath string `yaml:"raw_excerpt_path,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.