supportmanifest

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package supportmanifest records measured support for the ClickHouse API.

Index

Constants

View Source
const FormatVersion = 2

FormatVersion identifies the support manifest file format.

View Source
const FunctionProbeEvidenceFormatVersion = 2

FunctionProbeEvidenceFormatVersion identifies the live function evidence format.

Variables

This section is empty.

Functions

func LoadFunctionEvidence

func LoadFunctionEvidence(catalogPath, evidencePath string) (map[string]FunctionMeasurement, error)

LoadFunctionEvidence validates the live artifact and returns measured functions.

func Marshal

func Marshal(manifest Manifest) ([]byte, error)

Marshal returns the stable manifest representation.

func MarshalFunctionProbeEvidence

func MarshalFunctionProbeEvidence(evidence FunctionProbeEvidence) ([]byte, error)

MarshalFunctionProbeEvidence returns stable live evidence bytes.

func ValidateCurrent

func ValidateCurrent(inventory apiinventory.Inventory, functionRoster map[string]FunctionMeasurement, config Config, candidate Manifest) error

ValidateCurrent checks a manifest against all classification sources.

func ValidateWitnesses

func ValidateWitnesses(root string, manifest Manifest) error

ValidateWitnesses checks that every named Go test exists.

Types

type Config

type Config struct {
	FormatVersion int        `json:"format_version"`
	Overrides     []Override `json:"overrides"`
}

Config contains the strict support overrides.

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig reads the strict support overrides.

type Entry

type Entry struct {
	Kind             Kind     `json:"kind"`
	Name             string   `json:"name"`
	AliasTo          string   `json:"alias_to,omitempty"`
	Status           Status   `json:"status"`
	SemanticFamily   string   `json:"semantic_family"`
	Evidence         string   `json:"evidence"`
	TestWitness      string   `json:"test_witness"`
	AcceptedProducts []string `json:"accepted_products,omitempty"`
	RefusedProducts  []string `json:"refused_products,omitempty"`
}

Entry is one support verdict with its evidence and test witness.

type FunctionMeasurement

type FunctionMeasurement struct {
	Family      string
	Evidence    string
	TestWitness string
}

FunctionMeasurement is one live function support claim.

type FunctionProbeAnalysisResult

type FunctionProbeAnalysisResult struct {
	Raw          string            `json:"raw,omitempty"`
	Canonical    *conformance.Type `json:"canonical,omitempty"`
	RefusalClass string            `json:"refusal_class,omitempty"`
	ErrorCode    int               `json:"error_code,omitempty"`
}

FunctionProbeAnalysisResult records a type or a bounded refusal class.

type FunctionProbeCell

type FunctionProbeCell struct {
	ID          string                       `json:"id"`
	Expression  string                       `json:"expression"`
	Table       string                       `json:"table,omitempty"`
	Fixture     string                       `json:"fixture,omitempty"`
	Expectation conformance.Expectation      `json:"expectation,omitempty"`
	Chgen       conformance.TypeResult       `json:"chgen"`
	Analysis    FunctionProbeAnalysisResult  `json:"server_analysis"`
	Execution   FunctionProbeExecutionResult `json:"server_execution"`
	Native      conformance.NativeResult     `json:"native"`
}

FunctionProbeCell records the facts that identify one function probe.

type FunctionProbeEvidence

type FunctionProbeEvidence struct {
	FormatVersion  int                 `json:"format_version"`
	CatalogSHA256  string              `json:"catalog_sha256"`
	Report         FunctionProbeReport `json:"report"`
	ExecutionTypes map[string]string   `json:"execution_types"`
}

FunctionProbeEvidence binds live outcomes to one exact probe catalog.

func NewFunctionProbeEvidence

func NewFunctionProbeEvidence(catalogSHA256 string, report conformance.Report, executionTypes map[string]string) (FunctionProbeEvidence, error)

NewFunctionProbeEvidence removes server diagnostic prose from a live report.

type FunctionProbeExecutionResult

type FunctionProbeExecutionResult struct {
	Ran          bool   `json:"ran"`
	RefusalClass string `json:"refusal_class,omitempty"`
	ErrorCode    int    `json:"error_code,omitempty"`
}

FunctionProbeExecutionResult records execution or a bounded refusal class.

type FunctionProbeReport

type FunctionProbeReport struct {
	Metadata conformance.Metadata `json:"metadata"`
	Cells    []FunctionProbeCell  `json:"cells"`
}

FunctionProbeReport is a measured report without server diagnostic prose.

type Kind

type Kind string

Kind identifies one inventory class.

const (
	KindFunction                    Kind = "function"
	KindFunctionAlias               Kind = "function_alias"
	KindAggregateFunctionCombinator Kind = "aggregate_function_combinator"
	KindDataType                    Kind = "data_type_family"
	KindDataTypeAlias               Kind = "data_type_alias"
	KindTableFunction               Kind = "table_function"
	KindSetting                     Kind = "setting"
)

type Manifest

type Manifest struct {
	FormatVersion   int                 `json:"format_version"`
	Source          apiinventory.Source `json:"source"`
	InventorySHA256 string              `json:"inventory_sha256"`
	Entries         []Entry             `json:"entries"`
}

Manifest assigns one support verdict to every inventory item.

func Build

func Build(inventory apiinventory.Inventory, functionRoster map[string]FunctionMeasurement, config Config) (Manifest, error)

Build creates a complete manifest from the inventory and measured sources.

func Load

func Load(path string) (Manifest, error)

Load reads a support manifest file.

func (Manifest) ValidateAgainst

func (m Manifest) ValidateAgainst(inventory apiinventory.Inventory) error

ValidateAgainst checks the format and its exact inventory coverage.

type Override

type Override struct {
	Kind             Kind     `json:"kind"`
	Name             string   `json:"name"`
	Status           Status   `json:"status"`
	SemanticFamily   string   `json:"semantic_family"`
	Evidence         string   `json:"evidence"`
	TestWitness      string   `json:"test_witness"`
	AcceptedProducts []string `json:"accepted_products,omitempty"`
	RefusedProducts  []string `json:"refused_products,omitempty"`
}

Override changes the default verdict for one exact inventory item.

type Report

type Report struct {
	Total             int                     `json:"total"`
	Applicable        int                     `json:"applicable"`
	Measured          int                     `json:"measured"`
	MeasuredPct       float64                 `json:"measured_percent"`
	SupportedMeasured int                     `json:"supported_measured"`
	PartiallyMeasured int                     `json:"partially_measured"`
	SupportedPct      float64                 `json:"supported_percent"`
	StatusCounts      map[Status]int          `json:"status_counts"`
	KindCounts        map[Kind]map[Status]int `json:"kind_counts"`
}

Report contains coverage counts without source-code interpretation.

func Coverage

func Coverage(manifest Manifest) Report

Coverage derives the support totals from a validated manifest.

func (Report) SortedKinds

func (r Report) SortedKinds() []Kind

SortedKinds returns all report kinds in stable order.

type Status

type Status string

Status is one explicit support verdict.

const (
	// SupportedMeasured means that chgen has a rule and measured evidence.
	SupportedMeasured Status = "supported_measured"
	// ExplicitlyRefused means that chgen has a deliberate refusal.
	ExplicitlyRefused Status = "explicitly_refused"
	// PartiallyMeasured means that measured products have different verdicts.
	PartiallyMeasured Status = "partially_measured"
	// NotApplicable means that the item is outside the chgen API.
	NotApplicable Status = "not_applicable"
	// NotMeasured means that no support claim exists.
	NotMeasured Status = "not_measured"
)

Jump to

Keyboard shortcuts

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