attribution

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: 5 Imported by: 0

Documentation

Overview

Package attribution maps bounded differential evidence to versioned fault domains. It deliberately returns UNKNOWN when the evidence does not isolate a layer; it never uses majority behavior as protocol truth.

Index

Constants

View Source
const (
	TaxonomyVersion    = "fault-taxonomy-v1"
	CalibrationVersion = "rules-v1"
)

Variables

This section is empty.

Functions

func Family

func Family(domain Domain) (schema.FaultFamily, error)

func Fingerprint

func Fingerprint(scenarioID, assertionID, category string, expected, observed any) (schema.Digest, error)

Fingerprint intentionally excludes timestamps, request IDs, and ordering of map keys. expected and observed must already be redacted typed summaries.

func ValidatePair

func ValidatePair(domain Domain, family schema.FaultFamily) error

Types

type Domain

type Domain string
const (
	DomainTransport          Domain = "TRANSPORT"
	DomainAuth               Domain = "AUTH"
	DomainRequestMapping     Domain = "REQUEST_MAPPING"
	DomainProtocolSerializer Domain = "PROTOCOL_SERIALIZER"
	DomainStreamStateMachine Domain = "STREAM_STATE_MACHINE"
	DomainToolParser         Domain = "TOOL_PARSER"
	DomainReasoningParser    Domain = "REASONING_PARSER"
	DomainChatTemplate       Domain = "CHAT_TEMPLATE"
	DomainModelBehavior      Domain = "MODEL_BEHAVIOR"
	DomainSDKParser          Domain = "SDK_PARSER"
	DomainAgentOrchestration Domain = "AGENT_ORCHESTRATION"
	DomainGatewayTranslation Domain = "GATEWAY_TRANSLATION"
	DomainRateLimitTransient Domain = "RATE_LIMIT_OR_TRANSIENT"
	DomainHarness            Domain = "HARNESS"
	DomainSpecAmbiguity      Domain = "SPEC_AMBIGUITY"
	DomainUnknown            Domain = "UNKNOWN_FAULT_DOMAIN"
)

func Domains

func Domains() []Domain

Domains returns a stable list for schema/docs generation.

type Evidence

type Evidence struct {
	TransportReached       *bool
	AuthenticationAccepted *bool
	RawWireValid           *bool
	ReferenceAccepts       *bool
	SDKAccepts             *bool
	DirectAccepts          *bool
	GatewayAccepts         *bool
	StreamAccepts          *bool
	NonStreamAccepts       *bool
	ToolSyntaxValid        *bool
	ReasoningSyntaxValid   *bool
	HarnessHealthy         *bool
	TransientStatus        *bool
	SpecUnambiguous        *bool
}

Evidence is the result of explicitly bounded control experiments. Unknown booleans stay nil; treating missing evidence as false would over-attribute.

type Result

type Result struct {
	Domain       Domain             `json:"fault_domain"`
	Family       schema.FaultFamily `json:"fault_family"`
	Confidence   float64            `json:"confidence"`
	Alternatives []Domain           `json:"alternative_domains,omitempty"`
	Evidence     []string           `json:"evidence"`
	Taxonomy     string             `json:"taxonomy_version"`
	Calibration  string             `json:"calibration_version"`
}

func Classify

func Classify(input Evidence) Result

Classify applies conservative rules ordered from harness/precondition failures to increasingly specific differential evidence.

Jump to

Keyboard shortcuts

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