report

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJSON

func WriteJSON(path string, payload any) error

func WriteSummaryMarkdown

func WriteSummaryMarkdown(path string, rep Report) error

Types

type CalibrationParameters

type CalibrationParameters struct {
	PredicateOverlay  ParameterStatus `json:"predicate_overlay"`
	FaultContract     ParameterStatus `json:"fault_contract"`
	JourneyOverrides  ParameterStatus `json:"journey_overrides"`
	Baselines         ParameterStatus `json:"baselines"`
	HistoricalSignals ParameterStatus `json:"historical_signals"`
}

type ContractPolicy

type ContractPolicy struct {
	Status  string `json:"status"`
	Action  string `json:"action"`
	Message string `json:"message,omitempty"`
}

type Delta

type Delta struct {
	Current   float64 `json:"current"`
	Reference float64 `json:"reference"`
	Signed    float64 `json:"signed"`
	Absolute  float64 `json:"absolute"`
}

type Diff

type Diff struct {
	Name                     string        `json:"name,omitempty"`
	CurrentDigest            string        `json:"current_digest,omitempty"`
	ReferenceDigest          string        `json:"reference_digest,omitempty"`
	CurrentTopologyVersion   string        `json:"current_topology_version,omitempty"`
	ReferenceTopologyVersion string        `json:"reference_topology_version,omitempty"`
	CrossProfileWeighted     Delta         `json:"cross_profile_weighted"`
	CrossProfileUnweighted   Delta         `json:"cross_profile_unweighted"`
	Profiles                 []ProfileDiff `json:"profiles"`
}

func Compare

func Compare(current Report, reference Report, name string) Diff

type Diffs

type Diffs struct {
	Previous  *Diff  `json:"previous,omitempty"`
	Baselines []Diff `json:"baselines,omitempty"`
}

type EndpointDiff

type EndpointDiff struct {
	Profile      string      `json:"profile"`
	EndpointID   string      `json:"endpoint_id"`
	Availability Delta       `json:"availability"`
	Status       StatusDelta `json:"status"`
}

type FloatParameter

type FloatParameter struct {
	Value  float64 `json:"value"`
	Source string  `json:"source"`
}

type InputArtifact

type InputArtifact struct {
	Path            string `json:"path"`
	Digest          string `json:"digest"`
	ArtifactID      string `json:"artifact_id,omitempty"`
	Kind            string `json:"kind"`
	ContractName    string `json:"contract_name"`
	ContractVersion string `json:"contract_version"`
	SourceType      string `json:"source_type"`
	SourceRef       string `json:"source_ref"`
	ProducedAt      string `json:"produced_at,omitempty"`
	TopologyVersion string `json:"topology_version,omitempty"`
}

type IntParameter

type IntParameter struct {
	Value  int64  `json:"value"`
	Source string `json:"source"`
}

type MetricDiff added in v0.2.0

type MetricDiff struct {
	Metric     string `json:"metric"`
	TargetType string `json:"target_type"`
	Target     string `json:"target"`
	Status     string `json:"status"`
	Reason     string `json:"reason,omitempty"`
	Delta      *Delta `json:"delta,omitempty"`
}

type ParameterStatus

type ParameterStatus struct {
	Active   bool     `json:"active"`
	Source   string   `json:"source"`
	Path     string   `json:"path,omitempty"`
	Names    []string `json:"names,omitempty"`
	Fallback string   `json:"fallback,omitempty"`
}

type Parameters

type Parameters struct {
	ConfigSource string                `json:"config_source"`
	Profiles     []ProfileParameters   `json:"profiles"`
	Calibration  CalibrationParameters `json:"calibration"`
}

type PolicyEvaluation

type PolicyEvaluation struct {
	Mode             string                `json:"mode"`
	Decision         string                `json:"decision"`
	FailedEndpoints  []string              `json:"failed_endpoints"`
	FailedAssertions []string              `json:"failed_assertions,omitempty"`
	FailedProfiles   []string              `json:"failed_profiles,omitempty"`
	EvaluationRule   string                `json:"evaluation_rule,omitempty"`
	Reasons          []gate.DecisionReason `json:"reasons,omitempty"`
}

type ProfileDiff

type ProfileDiff struct {
	Profile             string         `json:"profile"`
	WeightedAggregate   Delta          `json:"weighted_aggregate"`
	UnweightedAggregate Delta          `json:"unweighted_aggregate"`
	Decision            StatusDelta    `json:"decision"`
	Endpoints           []EndpointDiff `json:"endpoints"`
	AdvancedMetrics     []MetricDiff   `json:"advanced_metrics,omitempty"`
}

type ProfileParameters

type ProfileParameters struct {
	Name               string          `json:"name"`
	Trials             IntParameter    `json:"trials"`
	Seed               IntParameter    `json:"seed"`
	SamplingMode       StringParameter `json:"sampling_mode"`
	FailureProbability FloatParameter  `json:"failure_probability"`
	FixedKFailures     IntParameter    `json:"fixed_k_failures"`
	FaultProfile       StringParameter `json:"fault_profile"`
	EndpointWeights    ParameterStatus `json:"endpoint_weights"`
}

type ProfileSummary

type ProfileSummary struct {
	Name                    string                   `json:"name"`
	Simulation              simulation.ProfileOutput `json:"simulation"`
	EndpointResults         []gate.EndpointResult    `json:"endpoint_results"`
	Decision                string                   `json:"decision"`
	EndpointsBelowThreshold int                      `json:"endpoints_below_threshold"`
	Aggregate               *gate.AggregateResult    `json:"aggregate,omitempty"`
	Reasons                 []gate.DecisionReason    `json:"reasons,omitempty"`
}

type Provenance

type Provenance struct {
	PredicateSource string `json:"predicate_source"`
	WeightsSource   string `json:"weights_source"`
}

type Report

type Report struct {
	Simulation          SimulationInfo        `json:"simulation"`
	EndpointResults     []gate.EndpointResult `json:"endpoint_results"`
	Summary             Summary               `json:"summary"`
	PolicyEvaluation    PolicyEvaluation      `json:"policy_evaluation"`
	InputArtifact       *InputArtifact        `json:"input_artifact,omitempty"`
	ContractPolicy      *ContractPolicy       `json:"contract_policy,omitempty"`
	Provenance          *Provenance           `json:"provenance,omitempty"`
	Parameters          *Parameters           `json:"parameters,omitempty"`
	Profiles            []ProfileSummary      `json:"profiles,omitempty"`
	Diffs               Diffs                 `json:"diffs,omitempty"`
	GeneratedAt         string                `json:"generated_at,omitempty"`
	RecomputeDurationMS int64                 `json:"recompute_duration_ms,omitempty"`
}

func Compose

func Compose(simOut simulation.Output, eval gate.Evaluation, params simulation.Params, confidence float64) Report

func ComposeAnalysis

func ComposeAnalysis(meta artifact.Loaded, simOut simulation.AnalysisOutput, eval gate.Evaluation, cfg config.AnalysisConfig, contractDecision config.ContractPolicyDecision, confidence float64, generatedAt time.Time, duration time.Duration) Report

func Load

func Load(path string) (Report, error)

func (Report) AvailabilityMap

func (r Report) AvailabilityMap() map[string]float64

func (Report) NormalizedProfiles

func (r Report) NormalizedProfiles() []ProfileSummary

func (*Report) SetBaselineDiffs

func (r *Report) SetBaselineDiffs(baselines map[string]Report)

func (*Report) SetPreviousDiff

func (r *Report) SetPreviousDiff(previous *Report)

type SimulationInfo

type SimulationInfo struct {
	Trials             int     `json:"trials"`
	Seed               int64   `json:"seed"`
	FailureProbability float64 `json:"failure_probability"`
}

type StatusDelta

type StatusDelta struct {
	Current   string `json:"current"`
	Reference string `json:"reference"`
	Changed   bool   `json:"changed"`
}

type StringParameter

type StringParameter struct {
	Value  string `json:"value"`
	Source string `json:"source"`
}

type Summary

type Summary struct {
	OverallAvailability              float64 `json:"overall_availability"`
	WeightedOverallAvailability      float64 `json:"weighted_overall_availability,omitempty"`
	CrossProfileAvailability         float64 `json:"cross_profile_availability,omitempty"`
	CrossProfileWeightedAvailability float64 `json:"cross_profile_weighted_availability,omitempty"`
	RiskScore                        float64 `json:"risk_score"`
	Confidence                       float64 `json:"confidence"`
}

func (Summary) CrossProfileAvailabilityOrFallback

func (s Summary) CrossProfileAvailabilityOrFallback() float64

func (Summary) CrossProfileWeightedAvailabilityOrFallback

func (s Summary) CrossProfileWeightedAvailabilityOrFallback() float64

Jump to

Keyboard shortcuts

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