report

package
v0.1.1 Latest Latest
Warning

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

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

Documentation

Overview

Package report renders one immutable result model into human and machine formats. Renderers never reinterpret verdicts or attribution.

Index

Constants

View Source
const BaselineSchemaVersion = "urn:agentapi-doctor:baseline:v1"
View Source
const (
	SchemaVersion = "urn:agentapi-doctor:report-bundle:v1alpha2"
)

Variables

View Source
var ErrIncomparable = errors.New("baseline and run have different immutable test identities")

Functions

func BaselineJSON

func BaselineJSON(baseline Baseline) ([]byte, error)

func HAR

func HAR(exchanges []HTTPExchange) ([]byte, error)

func HTML

func HTML(bundle Bundle) ([]byte, error)

func JSON

func JSON(bundle Bundle) ([]byte, error)

func JUnit

func JUnit(bundle Bundle) ([]byte, error)

func Markdown

func Markdown(bundle Bundle) ([]byte, error)

func SARIF

func SARIF(bundle Bundle) ([]byte, error)

func Terminal

func Terminal(bundle Bundle) ([]byte, error)

Types

type Baseline

type Baseline struct {
	SchemaVersion     string               `json:"schema_version"`
	Name              string               `json:"name"`
	ProfileDigest     schema.Digest        `json:"profile_digest"`
	PackDigest        schema.Digest        `json:"pack_digest"`
	SupportLockDigest schema.Digest        `json:"support_lock_digest"`
	DenominatorDigest schema.Digest        `json:"denominator_digest"`
	Cases             map[string]CaseState `json:"cases"`
}

func DecodeBaseline

func DecodeBaseline(raw []byte) (Baseline, error)

func NewBaseline

func NewBaseline(name string, bundle Bundle) (Baseline, error)

NewBaseline snapshots only exact comparable identities. A report without exactly one ProtocolPack is rejected rather than choosing one implicitly.

func (Baseline) Validate

func (baseline Baseline) Validate() error

type Bundle

type Bundle struct {
	SchemaVersion   string                             `json:"schema_version"`
	RunID           schema.InstanceID                  `json:"run_id"`
	IntentPlanRef   schema.ObjectRef                   `json:"intent_plan_ref"`
	ResolvedPlanRef schema.ObjectRef                   `json:"resolved_plan_ref"`
	Profile         schema.ArtifactPin                 `json:"profile"`
	Artifacts       []schema.ArtifactPin               `json:"artifacts"`
	SupportLock     schema.Digest                      `json:"support_lock_digest"`
	Denominators    schema.DenominatorSummary          `json:"denominators"`
	Outcome         schema.ProfileOutcome              `json:"profile_outcome"`
	Dimensions      map[string]schema.DimensionOutcome `json:"dimension_outcomes"`
	Cases           []schema.CaseResult                `json:"cases"`
	Conditions      []Condition                        `json:"conditions"`
	PrimaryExitCode int                                `json:"primary_exit_code"`
}

func Decode

func Decode(raw []byte) (Bundle, error)

func (Bundle) Validate

func (bundle Bundle) Validate() error

type CaseState

type CaseState struct {
	Disposition schema.PlanDisposition `json:"plan_disposition"`
	Execution   schema.ExecutionStatus `json:"execution_status,omitempty"`
	Verdict     *schema.Verdict        `json:"verdict,omitempty"`
}

type Change

type Change string
const (
	NewFailure     Change = "NEW_FAILURE"
	Regression     Change = "REGRESSION"
	Fixed          Change = "FIXED"
	Unchanged      Change = "UNCHANGED"
	NewCapability  Change = "NEW_CAPABILITY"
	NoLongerTested Change = "NO_LONGER_TESTED"
)

type Condition

type Condition struct {
	Code    string `json:"code"`
	Message string `json:"message"`
}

type Counts

type Counts struct {
	Pass         int `json:"pass"`
	Fail         int `json:"fail"`
	Warn         int `json:"warn"`
	Inconclusive int `json:"inconclusive"`
	Skipped      int `json:"skipped"`
	Errored      int `json:"errored"`
}

func Count

func Count(bundle Bundle) Counts

type Difference

type Difference struct {
	ScenarioID string     `json:"scenario_id"`
	Change     Change     `json:"change"`
	Before     *CaseState `json:"before,omitempty"`
	After      *CaseState `json:"after,omitempty"`
}

func Compare

func Compare(before, after Baseline) ([]Difference, error)

type HTTPExchange

type HTTPExchange struct {
	// contains filtered or unexported fields
}

HTTPExchange can only be constructed from payloads that crossed the redaction boundary. URL and headers are intentionally omitted because their independent sanitization belongs to the recorder.

func NewHTTPExchange

func NewHTTPExchange(started time.Time, duration time.Duration, method string, status int, request, response redaction.SanitizedPayload) (HTTPExchange, error)

Jump to

Keyboard shortcuts

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